Visual Basic

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Allen Browne's Audit Trail program to keep track of changes to my
database. It works very well but I have recently run into a problem.

In the MS VisualBasic editor, when I type the "." in Nz(Me.EHSR_Number, 0)
the program offers me a list of items to pick from for the table's Primary
Key. The current primary key is not an option. I have done something to
update this in the past and can not figure out what it was. Do you
understand what I am trying to say? I am a novice at this and sometimes my
explanations get confusing.

Thanks

David
 
Hi, David.
Do you
understand what I am trying to say?

I believe so. You expect the Intellisense feature (statement completion) to
offer you EHSR_Number, but it doesn't appear on the list. This is because
the query the form is bound to doesn't have EHSR_Number listed as one of the
fields, nor does the form have a control (such as a text box) with this name,
either.

Make sure that you add all of the fields you need for this form to the query
that this form is bound to. You don't necessarily need to ensure that a
control is also bound to this field, because the bound field becomes a
property of the form and can be referred to in code with the dot operator,
even if there isn't a control that uses this field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
This was left off the form as it is an autonumber that is there for the sole
purpose of having an autonumber. It serves no purpose in the form or table
and as such is not located on the form.

There are 2 queries associated with this form. Both of them have the same
wording to the letter and the capitalization as the Table and the Form.

I don't understand. It worked for a while, I created a new form with the
same name and now it does not work.

Thanks

David
 
If you need to reference it in the form, then you need it in the form, even
if you don't need to *see* it in the form.
 
Hi, David.
It serves no purpose in the form or table
and as such is not located on the form.

If it "serves no purpose," then why are you using it in the form's code?
Answer: Because it serves some purpose. You've implied that EHSR_Number is
the primary key for the table. If so, then it has a very important purpose
for the table, even if it weren't used in this form (but it sounds like it
is). The primary key is used by the database engine to identify individual
records in the table and to establish relationships between records in
different tables.
There are 2 queries associated with this form. Both of them have the same
wording to the letter and the capitalization as the Table and the Form.

If both queries are identical, then why do you need the copy?
It worked for a while, I created a new form with the
same name and now it does not work.

If the new form doesn't have the same record source or separate control
sources for individual controls not part of the form's recordset as the
original form, then there's no guarantee that the new form will work the same
way that the original form did.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.

- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 

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

Similar Threads

Audit Trail for Non Autonumber table 3
Allen Browne Help!!! 7
Report from Audit Trail 5
Database Corruption 2
Mr Browne's audit trail 8
A question on Allen Browne's Audit trail procedure? 2
Visual Basic 4
HELP! 5

Back
Top