Add Record to Form then update and show data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form which has a REF (combo box), SITE & ADDRESS (which are
both locked and disabled as the info automatically updates depending upon the
REF)

If there is no suitable REF in the combo box, the user must click a button
and add a REF, SITE & ADDRESS to a form that pops open. When they hit the
close button on this form, the data does not currently appear in the combo
box and when I refresh the data I have to search for it by scrolling.

Ideally I would like to add it the new REF, SITE & ADDRESS and it
automatically fills in.

Is this possible?
 
There is an easier way.
First, set the Combo's Limit To List property to Yes. That will cause the
Not In List event to fire if you enter a REF that does not exist in the
recordset. In that event, you can create a new record in the table and
populate the REF field with the value entered, make the new record the
current record for the form, unlock the SITE and ADDRESS controls and allow
the user to enter the values there rather than have to use a separate form.
 
Thanks for your quick reply, I forgot to mention that the REF is an
autonumber generated ID, and the SITE & ADDRESS fields from the form are
merged into a letter in Word.

I did try what you suggested, but it would not let me add a REF no as the
field is auto-numbered and the SITE & ADDRESS fields are brought in from the
external table.

I hope you understand what I am trying to say :-)

If you I am not too far off your intial suggestion, further help would be
appreciated or perhaps my original suggestion is possible..maybe!
 
Back
Top