Message from macro if a particular item on a list is selected

W

Wendy Simes

I am using Access 2003.
I have a message in a Macro which I would like to appear when a
particular word is selected from a drop down list. I can make the
message appear when the particular field with the drop down list in it
is selected on the form but cannot link it to a particular word.
The field in question is named Subject. In the list of subject are
cross references eg Probate see Wills. I want the message to appear
when *see* is selected from the list.
The field Subject is on a subform called Subject Link Subform, this is
a subform of Data Entry Form.
Thankyou
 
F

fredg

I am using Access 2003.
I have a message in a Macro which I would like to appear when a
particular word is selected from a drop down list. I can make the
message appear when the particular field with the drop down list in it
is selected on the form but cannot link it to a particular word.
The field in question is named Subject. In the list of subject are
cross references eg Probate see Wills. I want the message to appear
when *see* is selected from the list.
The field Subject is on a subform called Subject Link Subform, this is
a subform of Data Entry Form.
Thankyou

You just wish to display a message, not have the user react off the
message?

Off the top of my head this morning ......
Use CODE.

On the AfterUpdate event line of the combo box, write [Event
Procedure].
Then click on the little button with 3 dots that appears on that line.
When the Code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines write:

If InStr(Me![ComboName]," see ")>0 Then
MsgBox "Give your message here."
End if

Exit the code window.
 
W

Wendy Simes

I can see that that code should work.
However I think it doesn't work as the combo box gets its information
from a link table. There is a table called [Subjects] which is linked
through a table called [Link Table] to the main table called [Object
Details], as subjects and Objects are a many to many relationship.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top