Record Selector

L

Linda RQ

Hi Everyone,

Using Access 2003.

I have a combo box on a form. When an item is not in the list and the user
tries to enter text, I have a message box that opens up to instruct the user
to double click the field to add to the list. The double click event then
opens up my form which is set up as continuous. The problem is the record
selector is at the top of the forms records. If the user is not paying
attention, they may change that record. How can I get the record selector
to be focused on the blank record field at the bottom of the form or is
there a way to set the form so you can only add new records but still show
the records in that form?

Thanks,
Linda
 
V

Van T. Dinh

You can use the DataMode acFormAdd option in the OpenForm Method so that the
new Form is opened for adding only and doesn't show existing Records.

Alternatively, you can set the Property "DataEntry" of the Form to True /
Yes and when you open the Form with default DataMode, the Form will be
opened for adding only.

You can also use the GoToRecord Method to set the "NewRecord" as the current
record. You need to use this one if you want to show existing records.
Check Access VB Help on this method.

I am sure there are a few more methods I haven't covered ...
 
L

Linda RQ

Thanks, Van.

It looks like I need to use the 3rd option you suggested. I am trying to
avoid using VB for my database because I don't have a grasp on that and I
don't know what to do when there is an error but I tried looking up the
method and this is what I could come up with (the DoCmd line is highlighted
in yellow). I also stumbled on how to use it in the Macro builder and I did
get that to work so I at least can get it to work in a way I understand but
would like to get it to work in the VB module too.

Is there a way to get suggestions from the access help file for what access
has highlighted in yellow?

Private Sub Form_Load()
DoCmd.GoToRecord acDataForm, "frmPhysicians", acGoTo, NewRecord
End Sub

Runtime Error 2505: An expression in argument 4 has an invalid value

What's argument 4?

Linda
 
V

Van T. Dinh

DoCmd.GoToRecord , , acNewRec

Argurment 4 is the Offset which you don't use when you want to go to the
NewRec row.

Syntax and arguments are generally available in Access VB Help and there are
lots of examples in the Help topics.
 

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