Allen Browne Help!!!

B

Billiam

Allen , if you're out there, can I use your audit log in an Access 2007 ACCdb
format? If so, How do you turn "confirm Record changes" on? I am having
trouble with the following after I try to change a field, and I am not sure
why...

Compile error: method or data member not found

When i click on Okay I get the following--see 'my comments
Private Sub Form_BeforeUpdate(Cancel As Integer) 'this line is highlighted
in yellow
bWasNewRecord = Me.NewRecord
Call AuditEditBegin("TblFSESO", "AuditTmpTblFSESO", "InstructorID",
Nz(Me.InstructorID, 0), bWasNewRecord) ' .InstructorID is highlighted in grey
End Sub

InstructorID is a primary key Autonumber long integer on which the form to
be audited is based on the TblFSESO...

Please help Anyone!
 
A

Allen Browne

In the article at:
http://allenbrowne.com/AppAudit.html
scroll down to the section:
Enter the Form Events
Step 1 calls for you to declare bWasNewRecord.

As stated near the top of the article, the code works with Access 2007
except for tables that use a Multi-Valued Field.

To set the confirm options in Access 2007, click the Office Button (top
left), then Access options (bottom of dialog.)

The most common problem reported with this utility is where the tables are
not set up correctly, e.g. you skipped a field, the fields are out of order,
you inserted an extra PK at the top of the audit table, or you have a unique
index in the audit table that prevents the entries.
 
B

Billiam

Thanks for your help, Allen!

I am now getting the following error:

Compile error: Sub or function not defined

Err_AuditEditBegin:
Call LogError(Err.Number, Err.Description, conMod & ".AuditEditBegin()",
, False)
Resume Exit_AuditEditBegin
End Function

Call LogError is highlighted.

What have I missed???

Billiam
 
B

Billiam

Okay, Allen, I am now receiving the following error:

I received the following error message: Run-time error '3825': SELECT cannot
be used in an INSERT INTO query when the source or destination table
contains a multi-valued field.

Yes I am using Access 2007, but I am not using a multi-valued field. How can
I confirm that I am not using a multi-valued field?

Billiam
 
A

Allen Browne

Billiam said:
Okay, Allen, I am now receiving the following error:

Will have to let you debug this for yourself. It does work, but you do have
to get your tables right, and your SQL statement right.

In table design view, the properties for the field (lower pane of the table
design window) will tell you if you have set up a field with a combo to
accept multiple values.
 
B

Billiam

I really appreciate your help, Allen. I have gone through every field as
suggested and I do not have a multi valued field. I Have checked and
rechecked my tables. Afraid this is beyond meat this time.
Thanks anyways for trying to help me, I really appreciate it!
Have a great day,
Billiam
 
B

Billiam

Hi Allen,

Just in case anyone is following this thread, here is what I did wrong...

First I did not read carefully enough on setting up the tables...I
completely missed including the Primary key of the table the form was based
on, and changing it to a number, non indexed type (another reason you should
not be doing this late at night :-< .

Also, even though I went through my table in design view, I did not see
anything listed as a multivalued field. What I wasn't smart enough to realize
until I looked through my table types, is that obviously an attachment
datatype will allow multiple values in a field. When I removed this field
from tables, I no longer recieved the error, and my edits etc were logged.
HOOOOOOORRRRRAAAAY!!!!!!!!!!!!!!!!!!!!!
Just thought I'd let you know you were right, and I WAS WRONG! <g>

Have a great week, and many, many thanks again for your help, Allen! Also,
many thanks for the whole procedure as well, It will be years before I can do
stuff like that on my own---okay decades...centuries???
Billiam
 
A

Allen Browne

Billiam said:
... an attachment datatype will allow multiple values in a field.
When I removed this field from tables, I no longer recieved the error,
and my edits etc were logged.
HOOOOOOORRRRRAAAAY!!!!!!!!!!!!!!!!!!!!!

That's great news. All the best.
 

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