Accessing Tables with VBA code

C

Chin Bhat

Hi,

I am writing a program with Access using VBA. I have a
table and need to do the following:

- stop Access from automatically creating a new blank
record
- create and jump to a new record (using code)


Thanks a lot for your help in advance, I really
appreciate it.

Chin.
 
J

John Vinson

Hi,

I am writing a program with Access using VBA. I have a
table and need to do the following:

- stop Access from automatically creating a new blank
record
- create and jump to a new record (using code)

Is the user viewing the data on a Form? If so, you can set the Form's
AllowInsert property to False (to keep them from seeing the new
record); in your code you can include a line

DoCmd.GoToRecord acDataForm, "NameOfYourForm", acNewRecord

to go to the new record. (You don't need to create a new record, it's
always there).

John W. Vinson[MVP]
(no longer chatting for now)
 
C

Chin Bhat

Thanks for your reply. The user is not actually viewing
the records. He/She is just entering information into
the viewer. I actually dont want a new record to just be
there. I want to create it at a certain point in the
program. Thanks.

Chin Bhat.
 
J

John Vinson

Thanks for your reply. The user is not actually viewing
the records. He/She is just entering information into
the viewer. I actually dont want a new record to just be
there. I want to create it at a certain point in the
program. Thanks.

I'm sorry, I think we're miscommunicating.

What is a "viewer"? That's not a term that has any meaning to me, in
an Access context.


John W. Vinson[MVP]
(no longer chatting for now)
 

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