[AccessD] Try this one again

John Clark John.Clark at niagaracounty.com
Wed Dec 23 06:44:16 CST 2009


No...looking back on what I wrote, I can see this does sound like what I was looking for, but no...I am just trying to convert it to text, so that I can use it in the form. I didn't think this would be a problem, but I am getting errors on the 4-5 numeric fields I need...if I REM them out, all works well. However, I will keep this in mind, and maybe I'll mention that we have the ability to do this...they might actually like that.
 
As for the parsing issue, I took a stab at it, and I couldn't believe how easy it turned out. Once I started writing down the logic on paper, it became quite clear, and I whipped up a quick CASE statement...four cases...and it works great.
 
day = Left(Right(datDate, 7), 2)
Select Case day
    Case 1, 21, 31
        daysuffix = "st"
    Case 2, 22
        daysuffix = "nd"
    Case 3, 23
        daysuffix = "rd"
    Case Else
        daysuffix = "th"
End Select
 
I could actually simplify this even more, and make it work for all numbers...right now it just covers up to 31 days in a month...by changing the first statement to look at just the last digits, instead of the last two digits. Then I ony have to check for 1, 2, or 3. I think that would work.

>>> "Reuben Cummings" <accessd at gfconsultants.com> 12/22/2009 1:05 PM >>>
John, there is code out there for converting dollars to text.  I assume you
want 20.50 to read "Twenty dollars and 50 cents"
Google "q210586" for the knowledge base article on it.  Copy and paste the
code.

To parse the date as you mentioned look into Datepart.

Reuben Cummings
GFC, LLC
812.523.1017


> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
> Sent: Tuesday, December 22, 2009 11:15 AM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Try this one again
> 
> 
> Well, Reuben (and others), I don't understand why it made a 
> difference, but this appears to have been the problem...I 
> added all fields, that I am using, to the report, at the 
> bottom (I'll hide them later), and it is complying much better for me.
>  
> Isn't there a way to grow/shrink the labels? I've never done 
> it, but I thought there was a way to do this. My paragraph 
> spacing, I'm afraid, will be subject to various spacing and 
> I'd like to make it more dynamic. Eh...I can live w/this, if 
> I get down to it being the only issue.
>  
> Now it is on to converting numbers to text...AND, something I 
> failed to recognize, when I first planned out this project, 
> parsing out the date. I don't think it will be real 
> difficult, but I'm already behind, and I'm trying to finish 
> this thing up, so I can enjoy a vacation w/out thinking about 
> this place. Basically, the date December 1, 2009, will have 
> to read "...on this 1 day of December, 2009" I may go fancy 
> and add the "st" "nd" "rd", etc. as well. But, that isn't a 
> necessity to them...I'm more particular than they are I think.
> 
> >>> "John Clark" <John.Clark at niagaracounty.com> 12/22/2009 
> 10:46 AM >>>
> Yes, it is Reuben. Actually, what I am doing, is running a 
> query based on a form, which queries the main table, based on 
> the current voucher number...the one distinguishing field. 
> This will allow me to have one single record, and all of its 
> fields, for the report. It was really the only way I could 
> think to do it...to print a voucher for the active record..
> 
> I did the 1st paragraph this morning, and I got it all 
> working...except for the number to text conversion that I put 
> off until later. Now, it seems that nothing wants to work. I 
> didn't do anything, but move on to paragraph #2
> 
> >>> "Reuben Cummings" <accessd at gfconsultants.com> 12/22/2009 
> 9:47 AM >>>
> First, the reports recordsource is this query, correct?
> I would then place all the fields on the report and hide them 
> (visible =
> false).
> And while Witness may work I always use me.Witness (easier 
> for me to follow
> where witness is coming from).
> 
> Reuben Cummings
> GFC, LLC
> 812.523.1017
> 
> 
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com 
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of 
> John Clark
> > Sent: Tuesday, December 22, 2009 8:46 AM
> > To: 'Access Developers discussion and problem solving'
> > Subject: Re: [AccessD] Try this one again
> > 
> > 
> > OK, I am taking your advice, and I've started doing this. I'm 
> > finding that isn't all that bad, and I think it will look 
> > alright. The trouble I am now having though, is that I am 
> > unable to bring the data into the paragraph. In the code, for 
> > the OnLoad event of the form, I am doing this:
> >  
> > Dim P1, P2, P3 As String
> >  
> > P1 = Witness
> > P1 = P1 + " - Being duly sworn, says that he/she attended as 
> > a witness on behalf of the People "
> > P1 = P1 + "before the above court, pursuant to a subpoena or 
> > at the request of the District "
> > P1 = P1 + "Attorney and that he traveled from the 
> > City/Town/Village of "
> > P1 = P1 + txtWitCity
> > P1 = P1 + ", in the State of New York, which said place is "
> > P1 = P1 + numMileage
> > P1 = P1 + " miles from the Court House in the City of Lockport."
> >  
> > Me.lblParaOne.Caption = P1
> >  
> >  
> > I've tried other things, but what is the code for getting a 
> > field (Witness, txtWitCity, numMileage) out of the query? I 
> > don't need to do this the "long" way do I?
> > 
> > >>> "Reuben Cummings" <accessd at gfconsultants.com> 12/21/2009 
> > 11:44 AM >>>
> > I would stick with Access reports.  I make all kinds of reports for
> > government work all using Access.  And if the formatting is 
> > tough to copy
> > you'd be surprised what you can convince people to change to.
> > I've nearly changed the culture of "claims" in the state of 
> > Indiana.  The
> > old form was ridiculous - and I couldn't match it.  So I 
> convinced one
> > county to change years ago and now it's on the verge of being 
> > the standard.
> > 
> > And if you are placing parts of your data into pre-worded 
> > paragraphs (the
> > paragraph wording is pre-defined other than your data) do all 
> > the paragraph
> > building in code.   
> > 
> > Reuben Cummings
> > GFC, LLC
> > 812.523.1017
> > -- 
> > AccessD mailing list
> > AccessD at databaseadvisors.com 
> > http://databaseadvisors.com/mailman/listinfo/accessd 
> > Website: http://www.databaseadvisors.com 
> > 
> 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd 
> Website: http://www.databaseadvisors.com 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd 
> Website: http://www.databaseadvisors.com 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/accessd 
> Website: http://www.databaseadvisors.com 
> 



-- 
AccessD mailing list
AccessD at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/accessd 
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list