Results 1 to 2 of 2
  1. #1
    New Lounger
    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 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]
    End Sub

    - If you need to set more fields, add instructions to Form_Load.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts