[AccessD] In the meantime...simple syntax question

Mark A Matte markamatte at hotmail.com
Tue Oct 11 14:53:34 CDT 2005


John,

I think the problem originates with the combo displaying a description of 
the the value you are using...meaning the combo displays the description 
field "Vacation", but uses the ID field "V" to do your query stuff.  If you 
still wanted to use this method...you could set focus to the field set a 
variable equal to the .seltext and then display your message...or use a 
dlookup or something.  This may be the 'wrong' way...but should work...

**********************
Dim Type
Dim Month
me!cboTOType.setfocus
Type=cboTOType.SelText
me!cboMonth .setfocus
Month=me!cboMonth .SelText
SummaryText = "This data represents all " & Type & " time taken,
for employee "
SummaryText = SummaryText & txtEmpNum & ", for " & Month & ", " &
txtYr
lblSummary.Caption = SummaryText
**********************
...then just put the focus back to where you need.

Probably kinda ugly but gets what you need.

Hope it helps,

Mark A. Matte

>From: "John Clark" <John.Clark at niagaracounty.com>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: <accessd at databaseadvisors.com>
>Subject: [AccessD] In the meantime...simple syntax question
>Date: Tue, 11 Oct 2005 15:07:26 -0400
>
>I just posted, what I believe to be, a difficult question. But, in the
>meantime, allow me to pose something that should be quite a bit easier.
>
>I have a label on my form, which I am using to notify the user exactly
>what is being queried. The problem, if you could even call it a problem,
>is that if you filling in following data:
>
>      txtEmpNum = "10080"; cboTOType = "Vacation"; cboMonth = "June";
>and txtYr = "2005"
>
>you will get the following string in the label, "lblSummary"
>
>     "This data represents all v time taken, for employee 10080, for
>JUN, 2005"
>
>and I would like it to say, "This data represents all Vacation time
>taken, for employee 10080, for June, 2005"
>
>The following is the code snippet that I am doing this with:
>
>'Set summary text to let user know exactly what is being queried
>SummaryText = "This data represents all " & cboTOType & " time taken,
>for employee "
>SummaryText = SummaryText & txtEmpNum & ", for " & cboMonth & ", " &
>txtYr
>lblSummary.Caption = SummaryText
>
>And I tried changing it to:
>
>'Set summary text to let user know exactly what is being queried
>SummaryText = "This data represents all " & cboTOType.SelText & " time
>taken, for employee "
>SummaryText = SummaryText & txtEmpNum & ", for " & cboMonth.SelText &
>", " & txtYr
>lblSummary.Caption = SummaryText
>
>
>i.e. Adding ".SelText" to the two combo box control calls
>
>but then I get, "You can't reference a property or a method for a
>control unless the control has focus"
>
>OK...now what? Any ideas? The only one I've got in my head right now,
>is to set up parameters to send to the function that does this, but they
>would have to be global...so maybe I add the code snippet above to each
>of the field's "AfterUpdate" event and do it there? Again...any ideas?
>
>Thanks again. I'm flustered and going home for the night. I've got a
>headache and I've gotta stop at the pet store and buy crickets for my
>son's anoles...spelling?..."lizards." Then, I've got to stop by the
>football field and pass on the stats from last game. Is 4:00 PM too
>early to go to bed?
>
>Tomorrow is a new day...and hopfully a much better one ;)
>
>Take care all!
>
>John W Clark
>--
>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