lookup combo box in subform

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

Guest

Hi,
I'm trying to make a lookup combo box for a subform, but i find out that i
dun have that option when when i use the wizard to help me do the job.

it is possible to have a lookup combo box in a subform? and what should i do
if it's possible?~

Thanks!!
Hackman Chan
 
Hi, Chan.

Yes, you can place a combo box on a subform, although I'm not sure if your
problem is editing the subform or invoking the wizard.

If its the former, edit the subform either by loading the subform in design
mode, or by loading the main form in design mode, and double-clicking into
the subform. Then place your combo box within the subform.

If your problem is that the wizard is not active, toggle it on by View,
Toolbox, (depress the button with the wand and stars).

Hope that helps.
Sprinks
 
Hi Sprinks,

Actually what I'm trying to do is to have a lookup combo box in the subform,
and the the combo box can "find a record on my subform based on the value I
seleced in my combo box." I can't find such an option in the wizard when
creating the lookup box. What should I do to make such a lookup combo box in
the subform?

Thanks!!
Hackman Chan
 
OK.

Place the combo box, using the wizard if desired, and tell it to "Remember
the value for later". This will mean it is Unbound, and the data selected in
it will not be stored in your table. Then in its AfterUpdate event, adapt
the following code to your field names:

Me.RecordsetClone.FindFirst "YourLookupFieldName = " & Me!YourComboBox
If Me.RecordsetClone.NoMatch Then
MsgBox Me!YourComboBox & " Not Found"
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If

Hope that helps.
Sprinks
 
Back
Top