Shawn Wysocki
09-27-2000, 10:54 AM
Heres my problem. I have three tables, and three forms, one per table, but on the first form (my opening form) there are two button liking to the other two forms. I want to be able to enter in a social security number in the first field of the opening form, and when the user clicks on one of the buttons to go to one of the other forms, I want it to have the information, From it's respected table that goes along with the Social security number from the first form, in it's other fields.
Please e-mail me if anyone has any ides
BarkerD
09-27-2000, 11:08 AM
There are a couple of different ways you could accomplish this. I am assuming that
The easiest way is to use one form for all of the information. You could use a Tab Control, and place each of the sub-forms on a separate page.
The other way would be to write some code for the command button that specifies the linking criteria.
eg.
dim strFormName as string
dim strLinkCriteria as string
strFormName = "Your Form Name"
strLinkCriteria="[SocialSecurityNumber FieldName]= """ & me.[ControlName of Social Security Number on Form] & """"
docmd.openform(strFormName,,strLinkCriteria)
Note: I have assumed that the Social Security Number field is text. If it is integer, remove 2 "" from around criteria.
This should limit the result on the form opened to just the information related to the specific Social Security Number you have chosen.
You may want to enhance this code, and check for a valid value etc.
Regards,
Duane Barker