Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't go to te specified record

Status
Not open for further replies.

GussyBoy

IS-IT--Management
Mar 11, 2003
96
BS
What does this messge mean? Also, would these four seperate lines of code have anything to do with the message?

DoCmd.OpenQuery stDocName, acNormal, acAdd
DoCmd.OpenQuery stDocName, acViewNormal, acAdd
Me.Dirty = False
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70


Please help.
 
Why do you open the query twice, it has everything to do with it, and if when u open it once it dosnt work, your problem is with your SQL/query....
 
Sorry. I should have added to the other lines of code. Both OpenQuery commands are for two separate queries. What does eachof these lines do?
 
Code:
Docmd.openquery [COLOR=red yellow]"[/color]stdocname[COLOR=red yellow]"[/color],,acadd

Thats what would work....
I suggest you take a look at this site for any further questions... 
[URL unfurl="true"]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/[/URL]

You go in office vba references, Methods, and openquery methods....
 
Code:
Docmd.openquery [COLOR=red yellow]"stdocname"[/color],,acadd
don't put the
Code:
 in front...
 
I'll gve it a try....the link says Directory Listing Denied. Do you have another point of reference?
 
Here's my code...This is used in a multiuser environment. For instance, if there are two users using the database, the subject error surfaces when the second user clicks the command button to run this code. Why is this?

Sub Submit()

Dim stDocName As String

Forms![voucher entry]![VoucherNum] = Text24
Forms![voucher entry]![DueDat] = txtDueDat
Forms![voucher entry]![VoucherDat] = txtVoucherDat
Forms![voucher entry]![VoucherNetAmt] = txtVoucherNetAmt
Forms![voucher entry]![VendorName] = Combo156
Forms![voucher entry]![VendorNum] = Text158

DoCmd.GoToRecord , , acNewRec

stDocName = "Submit tmpInvoices"
DoCmd.OpenQuery stDocName, , acAdd

stDocName = "Delete tmpInvoices"
DoCmd.OpenQuery stDocName, , acAdd

'Me.Dirty = False
'DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70


End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top