I have my own naming conventions for my files and fields within. I am trying to duplicate D39 (for example) and replace their files and fields with my own. I keep geting an Variable not found Error.
Any ideas as to what I doing wrong.
Kevin Robertson
@Reply 11 months ago
Sounds like either a variable is misspelled or missing.
Show us the error.
What line is highlighted?
Michael AlbertOP
@Reply 11 months ago
Michael AlbertOP
@Reply 11 months ago
Michael AlbertOP
@Reply 11 months ago
Michael AlbertOP
@Reply 11 months ago
Now I'm getting a syntax error, but it's the same line that was giving me the original error.
I uploaded the error message, the line in question and the file layout of TPR10bD39DocIndex.
Donald Blackwell
@Reply 11 months ago
Try moving your SQL statement into a string and statusing it before trying to execute the query. That will show you what Access is working with:
DetailsStatusBox = ""
Status "Indexing..."
' AbortBtn.Visible = True
Dim S as String
S = "DELETE FROM TPR10bD39DocIndex WHERE TPR10bDocID = " & TPR10DocID
Status S
CurrentDb.Execute S
Kevin Robertson
@Reply 11 months ago
I would be looking at the Primary Key and use the NZ Function in case a Null value is returned.
CurrentDb.Execute "DELETE FROM TPR10bD39DocIndex WHERE TPR10bDocIndexID=" & Nz(TPR10DocIndexID,0)
Michael AlbertOP
@Reply 11 months ago
That shows TPR10bDocID as being empty
Michael AlbertOP
@Reply 11 months ago
Kevin, when I try your suggestion i get the same results.
Michael AlbertOP
@Reply 11 months ago
I notice that the forms Record Source is TPR10aD39Doc, and that file does not contain TPR10bDocIndexID. Does that matter?
Kevin Robertson
@Reply 11 months ago
Show us your Form (Design View AND Form View).
Kevin Robertson
@Reply 11 months ago
Then that is the problem. Access has no idea what that field is.
Michael AlbertOP
@Reply 11 months ago
Well, the thing is I'm following Richard in Developer 39 step by step and his works fiine. It also works fine in my production db., but that uses the original files, not my files. I've got to leave this for now for the rest of the morning. I'll get back as soon as I can, and thank you very much for the help.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 39.