Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2007, 04:31 PM
Authorized User
 
Join Date: Mar 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Retrieve Autonumber field and update it

Hi,

I have a subform that has a table as record source. I'm including this subform on another form.
Now when user enters values in the subform, it inserts those values in the table and this table has a autonumber field so every insert generates a new autonumber.

In my form I have some more fields from check box that i have to relate to the autonumber generated from subform.

My question is how do I access the autonumber I generated and update some values on that particular autonumber related fields?

Eg.

Table1
Fields - F1, F2 and F3
Autonumber - F1
Insert updates F1 and F2

How do I update F3 for F1 that was created?
 
Old November 2nd, 2007, 06:31 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Use a combo box on the main form and requery it when it gets focus.

Did that help?

mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old November 2nd, 2007, 07:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

I don't understand the question.

If a user updates fields in the subform and enters data for F2, why would that person also NOT enter data for F3 at that time manually as he/she did with F2?


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old November 2nd, 2007, 07:32 AM
Authorized User
 
Join Date: Mar 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The reason being that the fields in subform are like datasheet and can be entered multiple times however the checkbox can be entered just once and will apply automatically to all fields in subform.

If I use the update statement for check box in my code then user will not have to enter this for all the line items he enters in the subform.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Determine next autonumber field value U.N.C.L.E. SQL Server ASP 2 February 22nd, 2007 04:01 AM
AutoNumber field tulincim Access 5 June 6th, 2006 03:44 PM
Hiding Autonumber Field Brendan Bartley Access 4 November 14th, 2005 11:34 AM
Deriving an Autonumber field paulkholt Pro VB Databases 0 August 20th, 2004 10:51 AM
Table Autonumber Update chloe Access 7 February 27th, 2004 06:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.