Field check

Rmaster

Rmaster
Local time
Today, 21:52
Joined
Mar 7, 2005
Messages
25
Hello

I've a problem whit a field check.
I want to check a field from my form to a hole collom of a table, if ther's a match then a popupmsg dissapears. Now i've this code but i doesn't work.

Code:
If Me.FieldName.Value Like tblMytable.Name Then
MsgBox "Text"
End If

How can i make this work?
 
Hi,
I Have made a sample database for you, the Main form(frm1) contains the textboxes testfield and testfield2, the table i have made is called tbltest with 5 fields that i have put values in, also i have made a query called qry1. Put one of the words in the table into the testfield box and then click on the testfield2 box, if the word is in the table you will get a message "Already Present". I think this is what you wanted?
Feel free to ask for further advice.
Best Regards,
Chris
________
RC163
 

Attachments

Last edited:
Thanks for the reply

But that isn't what i was looking for, I've made an example.
If you open frmTest you see all record in the list, if you dubbelclick on the name a other forms opens. Tha tform must check if the value of the Fieldname (name) is the same as in the other table the field name in this case (Kees) is that name, if so a popupmsg comes.
 

Attachments

  • 1.zip
    1.zip
    16.3 KB · Views: 105
Hi,
I am still unclear as to what you want to achieve, i checked your code and it seems that when your opening the second form the value should be pulled from the option in the list box, therefore i ammended your code :
CODE:
Private Sub List2_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmTest2", , , "[ID] = " & Me.List2.Value
End Sub
END OF CODE

So now the second form pulls through the value, whats the next step you want? Do you want to check if whats in the Listbox is also presented in the tblName table? Please elaborate and clarify.
Best Regards,
Chris
________
R1200C
 
Last edited:
Thanks for your reply

If you dubbelclick on the name on frmTest, frmTest2 opens, if it opens i want it to check of the name in the form is the same as the name in the other table, if it is, a msgbox dissapears.
Sorry for my bad english
Greets Rmaster
 
See Attached File. I think it Might be something like that? Click on frmtest (Peit) and then (Kees) you will see the the message if the value is in the other table.
Best Regards,
Chris
________
herbal vaporizer
 

Attachments

Last edited:
that's exaclty what i mean
Thank you verry much for your help

Greets
Rmaster
 
Only 1 problem
he only checks the first one
If you put more names in the database he only checks for kees
u know a sollution for this?
Greets Rmaster
 

Users who are viewing this thread

Back
Top Bottom