new vs existing record to be entered / edited

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

I have a form that opens with this command:
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd


on the form are 2 combo boxes
- the first is for a manufacturer's name, and has a row source of a table
with manufacturer's names
- the second is for a catalogue number, and has a row source of a table with
already entered catalogue numbers (for the manufacturer entered; it is
inactive till the manufacturer's info is entered)


what I would like to see happen is:

in the cboCatalogueNumber control, the user can either:
- pick from a list catalogue numbers already entered, this will then fire an
event to fill-out the rest of the form (with already entered data for that
manufacturer / catalogue number combination); this information can then be
edited

-or-

- type in a new number, which would require a new record to be entered...

I've tried a half dozen failing approaches, and think I might have my logic
cap on backwards !
Could someone please outline the sequence of commands I should be using.

thanks in advance
 
Mark said:
I have a form that opens with this command:
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

on the form are 2 combo boxes
- the first is for a manufacturer's name, and has a row source of a table
with manufacturer's names
- the second is for a catalogue number, and has a row source of a table with
already entered catalogue numbers (for the manufacturer entered; it is
inactive till the manufacturer's info is entered)

what I would like to see happen is:

in the cboCatalogueNumber control, the user can either:
- pick from a list catalogue numbers already entered, this will then fire an
event to fill-out the rest of the form (with already entered data for that
manufacturer / catalogue number combination); this information can then be
edited

-or-

- type in a new number, which would require a new record to be entered...

I've tried a half dozen failing approaches, and think I might have my logic
cap on backwards !
Could someone please outline the sequence of commands I should be using.


Use the combo box's NotInList event to open the catalog form
in dialog mode. Pass the NewData value in the OpenArgs
argument so the form can use its Open event to fill in the
new record's catalog id:
Me.catid.DefaultValue = """" & Me.OpenArgs & """"

Then set the event's Response argument to acDataErrAdded.
 
Back
Top