I have a database set up to keep track of traveller information for our company.
I have a form that is used to enter and view traveller information.
On this form is a subform that shows all of the travel discount programs the viewed traveller participates in. This subform links to the main form using the field "userid". The fields on this subform are:
1. userid
2. programid
3. program (this fills in automatically, based on the programid)
4. account number
5. notes
On the subform is another form, linked through "programid", which shows what each program can be used for.
As the user views the form, the subform shows as a datasheet, with a + by each program's record. WHen the + is clicked on, it opens the sub-subform and shows what that program is good for.
MY PROBLEM:
When a user is entering a new traveller or trying to add a program to an existing traveller, I need each new record added through the subform to automatically fill in the userid based on the userid shown on the main form. I created a form once before that did this for me, but I have been unable to get this one to work, and cannot figure out what I am doing wrong.
I have been trying to insert an expression in the "default value" property of the "userid" field in the subform. Currently, when I view the entire form, everything looks good until I look at the "userid" field on the blank record at the end of the subform. There, it says "#Name?". What the expression says at this point is:
=[main form name]![subform name]![userid]
I have also tried [main form name]![userid], at which point i got "#Error".
Thanks for any help you can offer,
Cheryl dc Kern
I have a form that is used to enter and view traveller information.
On this form is a subform that shows all of the travel discount programs the viewed traveller participates in. This subform links to the main form using the field "userid". The fields on this subform are:
1. userid
2. programid
3. program (this fills in automatically, based on the programid)
4. account number
5. notes
On the subform is another form, linked through "programid", which shows what each program can be used for.
As the user views the form, the subform shows as a datasheet, with a + by each program's record. WHen the + is clicked on, it opens the sub-subform and shows what that program is good for.
MY PROBLEM:
When a user is entering a new traveller or trying to add a program to an existing traveller, I need each new record added through the subform to automatically fill in the userid based on the userid shown on the main form. I created a form once before that did this for me, but I have been unable to get this one to work, and cannot figure out what I am doing wrong.
I have been trying to insert an expression in the "default value" property of the "userid" field in the subform. Currently, when I view the entire form, everything looks good until I look at the "userid" field on the blank record at the end of the subform. There, it says "#Name?". What the expression says at this point is:
=[main form name]![subform name]![userid]
I have also tried [main form name]![userid], at which point i got "#Error".
Thanks for any help you can offer,
Cheryl dc Kern