Adding data to beginnig of field

laurat

Registered User.
Local time
Today, 11:22
Joined
Mar 21, 2002
Messages
120
I have a field called AcceptReject that is a drop down menu with the choices A or R. When A is chosen I would like the comments form to open and todays date and the A to automatically fill into the comments field. If it is R I want the date and R to fill in. The first problem I have is that I put the code:

If AccpetReject = A Then
open the form and fill in

This is not working, it opens the form and fills it in no matter if A or R is picked.

Secondly, when it puts the date and the A in the field it is wiping out what is already in the comments field, I just want it to add the date and A to the beginning of the field, in front of what is already in there, I don't want it to be erased. I hope this makes sense, if there are any questions please let me know. Thanks.
 
Well

I can see a number of possible problems.

First off the equation should read

If AccpetReject ="A" Then

not

If AccpetReject = A Then

The next possible problem could arise from the way your combo boxes are set. Is the bound column actually equaling A or is an A just being displayed?

Anyway if you would like to get ahold of me to make arrangements to discuss it feel free.

DES
 
I am not sure if I understand what you mean by this:

The next possible problem could arise from the way your combo boxes are set. Is the bound column actually equaling A or is an A just being displayed?

I created the combo box using the wizard and put A and R as the two options. My email is l_taylor_ohio@yahoo.com if you'd like to communicate through email. Thanks.
 
I put " " around the A and now nothing happens when I choose A.
 
in the afterupdate event of the combobox, enter this command

MsgBox AcceptReject

Then change the value of the dropdown from A to R then back to A again. What pops up in the message box when you do this?
 
I forgot to say that the code to open the comments form and put the data in the field is in the After Update event of the combo box, does that change anything?? Should I still try what you suggested??
 
No it doesn't change anything, put the message box command before the code that opens the form.
 
That's why your code isn't working. AcceptReject doesn't equal A or R. Let's back up. What is your combo box's name?
 
Ah, now we have found the source of the problem!

If Combo22= "A" Then
open the form and fill in

Now, as far as the comments field, if the name of the form is frmComments and the name of the comments field is txtComments, after you open the form in your code use

forms!frmComments!txtComment=Date() & " A " & forms!frmComments!txtComment
 
Thank you so much for all your help!!! It works!!!:)
 

Users who are viewing this thread

Back
Top Bottom