delete query on a form

chris davies

Registered User.
Local time
Today, 17:44
Joined
Mar 20, 2005
Messages
86
HI there,
can anyone tell me hy I can't access/view a delete query when using the the wizard while putting a command button on a form?
The delete query is working fine i application mode.
thaks in advnace
Chris
 
Hmmm....

I didn't know this until I just tried it with the wizard. Delete queries don't show in the list.
You could:
Pick a different query and then change the query name in the code that the wizard writes.
The line looks like this...
stDocName = "Query1"

HTH,
Sarge.
 
I've already tried that (replacing the query name), I get an error message stating that Access can't find the query. There must be a way around this.
Chris
 
Well I just tried it again, and it works fine for me.

DoCmd.OpenQuery "QueryNameInQuotes"

or

stDocName = "QueryNameInQuotes"
DoCmd.OpenQuery stDocName

or even

strSQL = "DELETE [Field] FROM [tbl] WHERE [Field] Is Null"
DoCmd.RunSql strSQL
 
thanks :O)
just sticking the basic delete in there worked, i think because I was trying to use the wizard, the wizard may have been putting superfluous code in there somewhere. thanks again
Chris
 

Users who are viewing this thread

Back
Top Bottom