Want my subform info to autopopulate...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fork_In_Road

    Want my subform info to autopopulate...

    I have a main form with customer names & addresses, and a subform that
    I want to have the following: I wish to pull up an equipment name with
    a combo box (from my "equipment" table); then have the unit price and
    a monthly maximum charge auto-populate in the subform (both values are
    in the "equipment" table as well). Why am I having such a tough time
    with this? Have tried to create a form/subform with both the wizard
    and the toolbox/subform tool. Not having any luck. Suggestions?
    Thanks in advance.
  • Lumpierbritches

    #2
    Re: Want my subform info to autopopulate...

    You might want to create a query on the fly and use the following:

    Air Code

    Field1 = querycombo.colu mn(0)
    Field2 = querycombo.colu mn(1)
    Field3 = querycombo.colu mn(2)

    etc etc

    Rename the fields names to the textboxes you wish to auto populate. Rename the
    combox to the name of your combobox and use the code in the afterupdate.

    HTH

    Michael

    Comment

    • Salad

      #3
      Re: Want my subform info to autopopulate...

      Fork_In_Road wrote:
      [color=blue]
      > I have a main form with customer names & addresses, and a subform that
      > I want to have the following: I wish to pull up an equipment name with
      > a combo box (from my "equipment" table); then have the unit price and
      > a monthly maximum charge auto-populate in the subform (both values are
      > in the "equipment" table as well). Why am I having such a tough time
      > with this? Have tried to create a form/subform with both the wizard
      > and the toolbox/subform tool. Not having any luck. Suggestions?
      > Thanks in advance.[/color]

      Besides advice already provided...MF = Main form, SubForm = SF. You
      reference a field like this
      Forms!MF!SF!ID = ...
      Or
      Me!SF!ID = ...

      To get the recordsource of SF you enter
      strSource = Forms!MF!SF.For m.RecordSource



      Comment

      Working...