me.newrecord

  • Thread starter Thread starter Alain
  • Start date Start date
A

Alain

Hi to all,

I would like to use the Me.NewRecord but cannot it, when I compile it give
me method or data member not found
What is the reference I need to use for this

TIA

Alain
 
Alain said:
Hi to all,

I would like to use the Me.NewRecord but cannot it, when I compile it
give me method or data member not found
What is the reference I need to use for this

TIA

Alain

Where are you using it? It's only meaningful in a form's class module.
 
I'm using it behind a checkbox event

Private Sub Check5_Click()
If Me.NewRecord Then Exit Sub
' active checkbox
If Check7 = True Then
Check7 = False
End If
End Sub

Alain
 
Alain said:
I'm using it behind a checkbox event

Private Sub Check5_Click()
If Me.NewRecord Then Exit Sub
' active checkbox
If Check7 = True Then
Check7 = False
End If
End Sub

Alain

I don't see any reason that should not work. Are you sure the error is
occurring on that line, referring the NewRecord property?
 
Ye it is and the fun part is that I use the same validation on another db
and it is working (compiling) just fine, I have alson double check all the
references and they are the same...

I'll keep double checking everything to try to solve this mystery

Thanks

Alain
 
The only thing that occurs to me now is that your form or database may
be corrupt in some way. If so, possibly you could cure it by
decompiling the database. However, it's also quite possible there's
just something simple that we've overlooked.
 
Hi Dirk,

just found the problem, there was some old code on a unused form that it is
not being used anymore. It seem that I have some more clean up to do, but
the stange thing is when I was compiling before this error was not hapenning
at all, so I am starting to think that may be the db is getting corrupted.

BTY how do I decompile a db

Thanks

Alain
 
Alain said:
Hi Dirk,

just found the problem, there was some old code on a unused form
that it is not being used anymore. It seem that I have some more
clean up to do, but the stange thing is when I was compiling before
this error was not hapenning at all, so I am starting to think that
may be the db is getting corrupted.

BTY how do I decompile a db

1. With the database closed -- no users in it at all -- and (ideally)
Access not running, make a backup copy.

2. On the task bar, click Start -> Run...

3. Enter this (adapted to match your database path and name) in the Run
dialog box and click OK:

msaccess.exe /decompile "C:\My Documents\YourDBName.mdb"

You may need to include the full path to msaccess.exe, but I don't find
that to be the case when I try it. Depending on your Access version,
you may not get any sign that anything in particular happened. Your
database will probably open in Access.

4. Compact and Repair your database.

5. Open the database again, press Alt+F11 to switch to the VB Editor,
and click Debug -> Compile (your project). If any errors appear, fix
them and recompile.

6. Close the VB Editor. Compact & Repair again.
 
Excuse me for jumping in, but will decompiling fix these two problems I had
trouble with & just in case it happens again: 1. Access shut down before I
was able to close the database window, it won't open at all and throws an
database not MS Access blabla.., I eventually rewrote the whole thing. & 2.
I have been testing my new database so have accrued a number of entries in
all my tables & will need to get rid of them (returning record numbers to 0
for when I deploy it.
Thanks.
 
postman said:
Excuse me for jumping in, but will decompiling fix these two problems
I had trouble with & just in case it happens again: 1. Access shut
down before I was able to close the database window, it won't open at
all and throws an database not MS Access blabla.., I eventually
rewrote the whole thing. & 2. I have been testing my new database so
have accrued a number of entries in all my tables & will need to get
rid of them (returning record numbers to 0 for when I deploy it.

The first problem sounds like a different kind of corruption, and not
one that I would expect decompiling to solve, I'm sorry to say. I
suggest you read Tony Toews' Corrupt Access MDBs FAQ page:

http://www.granite.ab.ca/access/corruptmdbs.htm

The second problem, or rather wish, can generally be accomplished by
deleting all the existing records, then compacting the database by
clicking the menu items Tools -> Database Utilities -> Compact and
Repair Database... If that doesn't reset the autonumbers to zero, your
installation of Access and Jet is probably not up to date, and you
should visit Office Update to patch it.
 
Back
Top