Blank form and unbound combo box

PaveFE

New member
Local time
Yesterday, 18:01
Joined
Oct 27, 2013
Messages
5
I have a form that I would like to have blank fields when it is opened. I put the following in the "On Open" Event field of the form properties:

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub

However, it does not work.

Big picture - I have an unbound combo box on the form for users to select from, in which all the records on the form will populate with whatever is selected in the unbound combo box. I thought this was the problem at first, but even if I remove that from the form, the form still opens to the first record. If I set the "Data Entry" field to "Yes" on the Data tab, that works, but then none of the fields populate when using the combo box.

What am I missing??? Please help, need to have this done by tonight!
Thank you!
Vince
 
Try putting your code in the On_Load event for the form.
 
Never mind! After I compacted and repaired the database, and then opened it back up, it worked! Must have been some bad hidden code somewhere.
 

Users who are viewing this thread

Back
Top Bottom