Add New Record Probled

G

Guest

This may be a repeat as I am learning this newsgroup.
I have a combo box on a form to select Job records however the dropdown list
does not display the empty New Record. Is it possible to show an empty new
record in the dropdown box? Also is it possible to show this record at the
top of the list rather than at the bottom so that the user does not have to
scroll all the way to the bottom?

Thanks for helping a Newbe
 
J

John Vinson

This may be a repeat as I am learning this newsgroup.
I have a combo box on a form to select Job records however the dropdown list
does not display the empty New Record. Is it possible to show an empty new
record in the dropdown box? Also is it possible to show this record at the
top of the list rather than at the bottom so that the user does not have to
scroll all the way to the bottom?

No, and no. A Combo Box is designed to select existing data from one
table (and, ordinarily, to store one field from that selected record
into another table). If there is no data to select - e.g. the empty
"new record" - then there is nothing for the combo to read.

What you *can* do is edit the VBA code which the Wizard probably
generated in this combo's AfterUpdate event; add the lines

If IsNull(Me!comboboxname) Then
DoCmd.GoToRecord acForm, Me.Name, acNewRecord
End If

to the code to jump to the new record if the user doesn't select
anything.

John W. Vinson[MVP]
 
G

Guest

Thanks for the response. I do not understand "If the user does not select
anything" It seems to me that to trigger the after_update code somethins has
to be selected in the combo box. ?? where in the after_update code do the
lines that you suggested go?
 
J

John Vinson

Thanks for the response. I do not understand "If the user does not select
anything" It seems to me that to trigger the after_update code somethins has
to be selected in the combo box. ?? where in the after_update code do the
lines that you suggested go?

<blush> Sorry, you're quite right. Unless the combo contains a (UNION
query derived??) NULL record you can never select a null value.

John W. Vinson[MVP]
 

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