Results 1 to 2 of 2
2003-11-21, 22:01 #1
- Join Date
- Feb 2003
- Northfield, Minnesota, USA
- Thanked 0 Times in 0 Posts
Forms -inserting values (Access 2000)
I have a series of forms that walk the user through a process. First they pick the student that is getting a tutor (the tutee), They enter the last name and choose from a the list. The next form takes the student number of the tutee as a value and lets you search the table for the tutors last name and choose from a list again Then the values are displayed in controls on a form that I made based on the tutorSituations table.
I have the controls named as the fields are in the table, and the control source is: =[Forms]![Situation-setup3]![TuteeStunum]
My problem: I want this value to insert into the tutorSituations table in the tutee field. When I go to close the form it tells me the the Key value cannot be null.
How can I insert "=[Forms]![Situation-setup3]![TuteeStunum]" as tutee?
I hope this makes isn't too hard to follow. Thankyou for your help.
2003-11-22, 00:14 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Forms -inserting values (Access 2000)
If the control source of a control is a formula =..., the control is not bound to a field, so the value is not stored in the table. You might do the following:
- Set the Control Source of the text box to the name of the field, I suppose that's TuteeStuNum.
- In the On Load event of "frmTutorSituations", set the value of TuteeStuNum:
Private Sub Form_Load()
Me.TuteeStuNum = [Forms]![Situation-setup3]![TuteeStunum]
- If you need to set more fields, add instructions to Form_Load.