A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

I am receiving a "Strange" error: There is an invalid use of



 
 
Thread Tools Display Modes
  #1  
Old August 17th, 2004, 08:09 PM
jmcandrew
external usenet poster
 
Posts: n/a
Default I am receiving a "Strange" error: There is an invalid use of

. (dot) or ! operator or invalid parenthesis.

This occurs when I click a button (Next) on my form (frmEditStep). Here's
the code behind the button:

Private Sub Next_Click()
On Error GoTo Err_Next_Click

DoCmd.GoToRecord , , acNext

If Step_Num.Value = MaxStep.Value Then MoveDn.Enabled = False Else
MoveDn.Enabled = True

MoveUp.Enabled = True

Exit_Next_Click:
Exit Sub

Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click

End Sub
  #2  
Old August 17th, 2004, 08:27 PM
Roger Carlson
external usenet poster
 
Posts: n/a
Default

I would try Decompiling the database.



Occasionally, code can be deleted from the Source Code, but for some reason
is never removed from the Object Code. This code is never again seen on the
screen as text, but is still sitting there somewhere in the database file.
This can, at times, interfere with the normal operation of the program.



To remove these stray bits of code, you can "Decompile" your database and
then re-compile it. This process removes all of the compiled Object Code,
then when you re-compile it, you only get Object Code that reflects the
current Source Code.



To Decompile your database, do the following:



1) Click the Start button on the task bar and choose Run.

2) In the Run dialog box, type the following:
"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile
where the first part (in quotes) is the complete path to your Access
program. If you have the default installation, it is likely that it is just
as listed here. Click OK.

3) This will open Access and allow you to choose which database to
open. Whichever database you open will be decompiled.

4) Choose a database and open it.



5) Open any Module in design view, or any Form or Report in design view
and choose View | Code from the menu. In the next screen, choose Debug |
Compile from the menu bar.



Your database has now been Decompiled and Re-compiled.


--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


"jmcandrew" wrote in message
...
. (dot) or ! operator or invalid parenthesis.

This occurs when I click a button (Next) on my form (frmEditStep). Here's
the code behind the button:

Private Sub Next_Click()
On Error GoTo Err_Next_Click

DoCmd.GoToRecord , , acNext

If Step_Num.Value = MaxStep.Value Then MoveDn.Enabled = False Else
MoveDn.Enabled = True

MoveUp.Enabled = True

Exit_Next_Click:
Exit Sub

Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click

End Sub



  #3  
Old August 17th, 2004, 08:40 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"jmcandrew" wrote in message

. (dot) or ! operator or invalid parenthesis.

This occurs when I click a button (Next) on my form (frmEditStep).
Here's the code behind the button:

Private Sub Next_Click()
On Error GoTo Err_Next_Click

DoCmd.GoToRecord , , acNext

If Step_Num.Value = MaxStep.Value Then MoveDn.Enabled = False Else
MoveDn.Enabled = True

MoveUp.Enabled = True

Exit_Next_Click:
Exit Sub

Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click

End Sub


Have you verified that all of the names "Step_Num", "MaxStep", "MoveDn",
and "MoveUp" are the names of controls on your form?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #4  
Old August 17th, 2004, 08:49 PM
jmcandrew
external usenet poster
 
Posts: n/a
Default

Thanks for the suggestion. I ran the de-compile and re-complie and am still
getting the same error.

Any other ideas?

"Roger Carlson" wrote:

I would try Decompiling the database.



Occasionally, code can be deleted from the Source Code, but for some reason
is never removed from the Object Code. This code is never again seen on the
screen as text, but is still sitting there somewhere in the database file.
This can, at times, interfere with the normal operation of the program.



To remove these stray bits of code, you can "Decompile" your database and
then re-compile it. This process removes all of the compiled Object Code,
then when you re-compile it, you only get Object Code that reflects the
current Source Code.



To Decompile your database, do the following:



1) Click the Start button on the task bar and choose Run.

2) In the Run dialog box, type the following:
"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile
where the first part (in quotes) is the complete path to your Access
program. If you have the default installation, it is likely that it is just
as listed here. Click OK.

3) This will open Access and allow you to choose which database to
open. Whichever database you open will be decompiled.

4) Choose a database and open it.



5) Open any Module in design view, or any Form or Report in design view
and choose View | Code from the menu. In the next screen, choose Debug |
Compile from the menu bar.



Your database has now been Decompiled and Re-compiled.


--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


"jmcandrew" wrote in message
...
. (dot) or ! operator or invalid parenthesis.

This occurs when I click a button (Next) on my form (frmEditStep). Here's
the code behind the button:

Private Sub Next_Click()
On Error GoTo Err_Next_Click

DoCmd.GoToRecord , , acNext

If Step_Num.Value = MaxStep.Value Then MoveDn.Enabled = False Else
MoveDn.Enabled = True

MoveUp.Enabled = True

Exit_Next_Click:
Exit Sub

Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click

End Sub




  #5  
Old August 17th, 2004, 10:43 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

"Dirk Goldgar" wrote in message
...
"jmcandrew" wrote in message

. (dot) or ! operator or invalid parenthesis.

This occurs when I click a button (Next) on my form (frmEditStep).
Here's the code behind the button:

Private Sub Next_Click()
On Error GoTo Err_Next_Click

DoCmd.GoToRecord , , acNext

If Step_Num.Value = MaxStep.Value Then MoveDn.Enabled = False Else
MoveDn.Enabled = True

MoveUp.Enabled = True

Exit_Next_Click:
Exit Sub

Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click

End Sub


Have you verified that all of the names "Step_Num", "MaxStep", "MoveDn",
and "MoveUp" are the names of controls on your form?



Also, I'm not sure the If Then Else construct is valid. I thought it had to
be

If Step_Num.Value = MaxStep.Value Then
MoveDn.Enabled = False
Else
MoveDn.Enabled = True
End If


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)





  #6  
Old August 18th, 2004, 06:28 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"Douglas J. Steele" wrote in
message
"Dirk Goldgar" wrote in message
...
"jmcandrew" wrote in message

. (dot) or ! operator or invalid parenthesis.

This occurs when I click a button (Next) on my form (frmEditStep).
Here's the code behind the button:

Private Sub Next_Click()
On Error GoTo Err_Next_Click

DoCmd.GoToRecord , , acNext

If Step_Num.Value = MaxStep.Value Then MoveDn.Enabled = False Else
MoveDn.Enabled = True

MoveUp.Enabled = True

Exit_Next_Click:
Exit Sub

Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click

End Sub


Have you verified that all of the names "Step_Num", "MaxStep",
"MoveDn", and "MoveUp" are the names of controls on your form?



Also, I'm not sure the If Then Else construct is valid. I thought it
had to be

If Step_Num.Value = MaxStep.Value Then
MoveDn.Enabled = False
Else
MoveDn.Enabled = True
End If


No, a one-line "If ... Then ... Else ..." statement is still valid.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #7  
Old August 19th, 2004, 01:56 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

"Dirk Goldgar" wrote in message
...
"Douglas J. Steele" wrote in
message
"Dirk Goldgar" wrote in message
...
"jmcandrew" wrote in message

. (dot) or ! operator or invalid parenthesis.

This occurs when I click a button (Next) on my form (frmEditStep).
Here's the code behind the button:

Private Sub Next_Click()
On Error GoTo Err_Next_Click

DoCmd.GoToRecord , , acNext

If Step_Num.Value = MaxStep.Value Then MoveDn.Enabled = False Else
MoveDn.Enabled = True

MoveUp.Enabled = True

Exit_Next_Click:
Exit Sub

Err_Next_Click:
MsgBox Err.Description
Resume Exit_Next_Click

End Sub

Have you verified that all of the names "Step_Num", "MaxStep",
"MoveDn", and "MoveUp" are the names of controls on your form?



Also, I'm not sure the If Then Else construct is valid. I thought it
had to be

If Step_Num.Value = MaxStep.Value Then
MoveDn.Enabled = False
Else
MoveDn.Enabled = True
End If


No, a one-line "If ... Then ... Else ..." statement is still valid.


Your response triggered the obligatory slap to the forehead: I didn't think
of the possibility that there was word-wrap in the post.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)





  #8  
Old August 19th, 2004, 05:22 AM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"Douglas J. Steele" wrote in
message
"Dirk Goldgar" wrote in message
...

No, a one-line "If ... Then ... Else ..." statement is still valid.


Your response triggered the obligatory slap to the forehead: I didn't
think of the possibility that there was word-wrap in the post.


Heh, and I just automatically "unwrapped it" in my head, without even
considering the possibility that it might *not* have been wrapped. I
suppose only jmcandrew can tell us for sure.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #9  
Old August 19th, 2004, 01:29 PM
jmcandrew
external usenet poster
 
Posts: n/a
Default

I've got it as a single line. Have tried braking it up without success.

"Dirk Goldgar" wrote:

"Douglas J. Steele" wrote in
message
"Dirk Goldgar" wrote in message
...

No, a one-line "If ... Then ... Else ..." statement is still valid.


Your response triggered the obligatory slap to the forehead: I didn't
think of the possibility that there was word-wrap in the post.


Heh, and I just automatically "unwrapped it" in my head, without even
considering the possibility that it might *not* have been wrapped. I
suppose only jmcandrew can tell us for sure.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)



  #10  
Old August 19th, 2004, 09:47 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"jmcandrew" wrote in message

I've got it as a single line. Have tried braking it up without
success.


Did you check the control names as I suggested? Aside from that, I
can't explain the error you report at the moment. If you'd like to send
me a cut-down copy of your database, containing only the elements
necessary to demonstrate the problem, compacted and then zipped to less
than 1MB in size (preferably much smaller) -- I'll have a look at it,
time permitting. You can send it to the address derived by removing NO
SPAM from the reply address of this message.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Characters (looks like Chinese) in Access Form Sam Berry Setting Up & Running Reports 1 August 9th, 2004 05:29 PM
Invalid Product Key On Office 2003 60 Day Trial Setup, Installing & Configuration 1 July 14th, 2004 09:28 PM
Outlook Express Receiving mail !!!! Rodney Chelius Outlook Express 1 June 18th, 2004 05:43 AM
People are not receiving my emails G. Carefoot Outlook Express 3 June 3rd, 2004 05:25 PM
Getting around the Invalid reference Error abxy Worksheet Functions 1 February 19th, 2004 09:07 PM


All times are GMT +1. The time now is 05:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.