cbo box and Forms

C

Chris

I have a form that displays the clients details when the clients name is
selected from a combo box.

When the form loads the cbo box is empty but the form displays the first
record in the table.

How can I make the form empty untill I Select a client.

Extra Info - I'm using a bound form and unbound one
 
A

AlCamp

Chris,
When you open the form...
DoCmd.OpenForm "frmYourFormName", acNormal
DoCmd.GoToRecord , , acNewRec
This will open the form on a "new" blank record.

Not sure why your combo is empty, but you could try a combobox Requery
on the OnCurrent event of the form. If that doesn't do it, get back to the
NG with another post, with more info on your combobox setup.
hth
Al Camp
 
G

Guest

I'm having the same problem, and I think it stems from using an unbound combo
box. Is there any way to "preload" the first item in the control's recordset
when I open the form?
 
R

Roger Carlson

If you want the value of an unbound combo to match the record in the bound
form, do this in the On Current event:

Private Sub Form_Current()
Me.MyCombo = MyID
End Sub

Where MyCombo is the name of the combo and MyID is whatever value in the
bound form that matches the combo.
 
G

Guest

Thank you.

Roger Carlson said:
If you want the value of an unbound combo to match the record in the bound
form, do this in the On Current event:

Private Sub Form_Current()
Me.MyCombo = MyID
End Sub

Where MyCombo is the name of the combo and MyID is whatever value in the
bound form that matches the combo.
 

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