MAYDAY! MADAY! - Run time error

F

FatMan

Hi all:
I hope one of the Access gurus out there can help me with my problem. The
code below gets a runtime error on one of our grower's computer (32 Bit Vista
- Home Prem.). The code was developed on a computer running WinXP Pro - SP 2
and Access 2000. The installation included a copy of the access runtime.
What I don't understand is what would causes the runtime error on the vista
machine. Can anyone help? It seems like simple code to me with nothing to
difficult going on so why the runtime error?

Any help is greatly appreciated.

Thanks,
FatMan


Code:
Private Sub Command43_Click()
On Error GoTo Err_Command43_Click

Dim stDocName As String

If Me.labProfileLocked.Visible = Flase Then

'set warrnings off
DoCmd.SetWarnings False

'delete previous profile and append selected profile
stDocName = "qryGrowerProfileDel"
DoCmd.OpenQuery stDocName, acNormal, acEdit

stDocName = "qryGrowerAppend"
DoCmd.OpenQuery stDocName, acNormal, acEdit

'lock down form
Me.AllowAdditions = False
Me.AllowEdits = False
Me.AllowDeletions = False
Me.labProfileUnLocked.Visible = False
Me.labProfileLocked.Visible = True


Me.Requery


'create grower block info table
stDocName = "qryBlockInforGrowerDelete"
DoCmd.OpenQuery stDocName, acNormal, acEdit

'create grower block info table
stDocName = "qryBlockInfoGrower"
DoCmd.OpenQuery stDocName, acNormal, acEdit


'set warnings on
DoCmd.SetWarnings Ture

Else
MsgBox "Sorry the form must be unlocked to load Grower Profile.",
vbInformation + vbOKOnly, "Grower Profile: Locked!"
End If


'set warnings on
DoCmd.SetWarnings True

Exit_Command43_Click:
Exit Sub

Err_Command43_Click:
MsgBox Err.Description
Resume Exit_Command43_Click

End Sub
 
S

Stefan Hoffmann

hi,
What I don't understand is what would causes the runtime error on the vista
machine. Can anyone help?
Not really without knowing anything about the exact error message you get.


mfG
--> stefan <--
 
D

Dale Fye

I'd start with this line (where you misspelled FALSE). Do you have an
Options Explicit set at the top of the forms code module. If not, you need
to do this to prevent use of undeclared variables.

If Me.labProfileLocked.Visible = Flase Then

After that, I'm not sure what you are trying to do, besides opening a bunch
of queries. If you are going to create action queries (delete, append,
make-table), rather than using the OpenQuery method, I'd use the
docmd.execute "queryname" method. It is easier to read.
 
D

Dirk Goldgar

Dale Fye said:
If you are going to create action queries (delete, append,
make-table), rather than using the OpenQuery method, I'd use the
docmd.execute "queryname" method.

"DoCmd.Execute"? I think you meant "CurrentDb.Execute".
 
T

Tony Toews [MVP]

Mayday is a term which means "life is in grave and imminent danger".
http://en.wikipedia.org/wiki/Mayday_(distress_signal) Unless Access is
being used in a nuclear reactor or for medical procedures I don't see
how a newsgroup posting qualifies.
:
I hope one of the Access gurus out there can help me with my problem. The
code below gets a runtime error on one of our grower's computer (32 Bit Vista
- Home Prem.). The code was developed on a computer running WinXP Pro - SP 2
and Access 2000. The installation included a copy of the access runtime.
What I don't understand is what would causes the runtime error on the vista
machine. Can anyone help? It seems like simple code to me with nothing to
difficult going on so why the runtime error?

How do you know that that routine is causing the problem? Also what
are your references?

Sub ViewReferenceDetails()

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & "
- " & ref.FullPath
Next ref

End Sub

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
A

AccessVandal via AccessMonster.com

FatMan happens to be the name of the first atomic bomb during world war two.

Maybe he's trying to drop one here? ( or the stinky gas?)
 

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


Top