can Find record combo be bound??

B

Barry A&P

I have been using the find record combo Box the wizard creates to set a form
to a record. when i use the combo to look up a record it works great, However
if i then use the navigation buttons to advance to another record the Find
record combo retains the previous value. Users get confused. ive used the
Me.Combo4.Value = "" to set the combo back to Null which works but now im
being picky and dont like having two controls that basically deal with the
same info is there a way to have that find record combo always display the
forms current info?

Heres what i got.. (simplified)
T_Parts
PartID (pk)
PartNumber
PartDescription

T_SerialNumbers
SNID (pk)
PartID (ck)
SerialNumber
DateOn
DateOff

Form_PartsMain
PartID textbox
PartNumber Textbox
PartName Textbox
FindPart Combobox >>> It does the job but i dont like it,,
Form_PartsSubform
SNID
SerialNumber
DateOn
DateOff


This is what i would like

Form_PartsMain
Part lookup Combobox (something like Select PartID, PartNumber &", "&
Description)
Form_PartsSubform
SNID
SerialNumber
DateOn
DateOff

so the lookup combo would display the current record Part info when the form
is opened and navigated by record buttons, but would also allow you to goto
another record based on the combo.. The Part info does not get edited on
this form Only Serial number subform info.

Sorry so long winded
 
R

Rookie

Don't bind it-that's bad. You'll end up editing records when you think
you're navigating.

I put a line in the form's OnCurrent event:
Me.Combo4.Value=Me.PartID (or whatever field you're using to match the combo
box to the form)

The current event fires when you navigate to a new record-so this updates
the combobox value as you scroll through the records.
 
A

Allen Browne

It is possible to use a bound combo, and undo its value before you move to
another record. However, I must agree with the Rookie that this is a
confusing interface when one control does different things in different
contexts. About as useful as designing a car where one pedal is both the
accelerater and the brake.

In any case, you should be aware that "" is not the same as Null, and that
undoing the combo is not the same as setting a combo's value to "" (a
zero-length string) may fail (e.g. with numeric fields) or Null which fails
for required fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top