PC Review


Reply
Thread Tools Rate Thread

Access 2003 GoToRecord Problems

 
 
New Member
Join Date: Jul 2011
Posts: 1
 
      27th Jul 2011
I have a main form (Orders) with a subform (Orders Subform) for taking orders. When the user clicks on a button, a Search form pops up. The user selects one of the records, then clicks on a button on the search form which 1) captures data on the Search form, 2) closes the Search form, 3) goes to a new record on the Orders Subform, and 4) populates the record with the data captured from the Search form. If I leave out 3) everything works fine, but I can't get a new record and I need to do so. Here's the code on the button on the Search form:

Dim iISBN As String

'Capture data
iISBN = Me![Search Subform]("ISBN"))

'Close the Search form
DoCmd.Close acForm, "Search"

Forms!Orders![Orders Subform].Form.ISBN.SetFocus

'This is the statement that won't work
DoCmd.GoToRecord acDataForm, Forms!Orders![Orders Subform].Form, acNewRec

'Insert data from Search form - this works
Forms!Orders![Orders Subform].Form.ISBN = iISBN

The error for 3) is "An expression you entered is the wrong data type for one of the arguments."

Am I mis-specifying the path for the GoToRecord command? Thanks!

Last edited by KevinJ; 27th Jul 2011 at 08:49 PM..
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternative to GoToRecord acNewRec for Access ADP David H Microsoft Access 3 13th Mar 2010 05:49 PM
problems importing excel 2003 data into access 2003 =?Utf-8?B?RGF2ZSBG?= Microsoft Access External Data 1 2nd Oct 2006 09:03 PM
Access, GoToRecord, offset action argument =?Utf-8?B?RGFycmVsbA==?= Microsoft Access Getting Started 6 1st Aug 2005 04:45 PM
DoCmd.GotoRecord in Access97 vs. Access 2000 Laurie Brand Microsoft Access Form Coding 16 1st Apr 2004 09:10 PM
Access 2002/XP - DoCmd.GoToRecord does not work correctly Aldo Gautschi Microsoft Access 1 20th Oct 2003 02:09 AM


Features
 

Advertising
 

Newsgroups
 


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