Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2005, 10:50 PM
Registered User
Join Date: Jul 2005
Location: , ca, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default use vba to add a row to datasheet

I could use a pointer, I spent the past 2 days trying to get a form in Microsoft Access to use VBA to Create a new record from an Access Datasheet view, I am scanning a barcode in a combo box with a carriage return, then using on_exit to set focus to the next textbox that has a query combining the title, condition, description and price from the bar_code_id. The problem I am having is that I want the datasheet to then start a new blank line ready to accept another barcode input, I cannot get it to open a new row. If I inhibit the on_exit function of the combo box all I have to do is press the enter key a new blank row is opened with the cursor in the right position and I am ready for another barcode but I don’t perform the query. Any suggestions would be greatly appreciated.

  #2 (permalink)  
Old July 11th, 2005, 09:57 AM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

Move to the last row, then movenext.

To discover the code to do this, create a macro that does this (using the drop-downs that the macro editor provides), then convert the macro to a procedure.

Alternatively, you could create a button on the form which adds a new record using the control wizard, then utilize the code the wizard generates for creating a new record in creating a new record through your process.
  #3 (permalink)  
Old July 11th, 2005, 01:07 PM
Registered User
Join Date: Jul 2005
Location: , ca, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

 Thank you for the feedback, It is amazing how something so simple could elude me for so long. I used the button wizard to add a new record an then cut and pasted the code. I had already tried, Move to the last row, then move next in code, that did not work. I don't know how to use the macro builder, so I didn't even try that.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating Input from a Datasheet using VBA digby_dog Access VBA 1 October 6th, 2008 10:35 AM
Fill datasheet/Continuous form with vba code only Galateo Access VBA 0 May 9th, 2008 09:39 AM
Re: Add button on a form with datasheet view lxu Access 5 March 8th, 2004 06:19 PM
Datasheet View Auto Highlight a Row Dataman Access VBA 0 February 15th, 2004 11:16 AM
Datasheet View Column Width - VBA Dataman Access 1 February 5th, 2004 02:32 PM

All times are GMT -4. The time now is 12:13 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.