Wrox Programmer Forums
|
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 August 18th, 2003, 04:48 AM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default need help?

hi
i m developing a database in access.there is one table with 5 coloumns and one form to enter the data in the table.the coulumns of the table are serial #,product name,platform,version,application name.
now in the form there are 5 fields for each of these coloumns to be filled in by the user while entering data,except for the application name which is a combo box.there are 8 categories for the application name.now,what i wnt is that when i select a particular application name from the combo box,the last+1 serial # of that application name should be displayed in the next field labelled as Serial #.this last+1 serial should come from the serial # coloumn of the table

so does anyone know how can i acheive it.also plz keep in mind that i dont know much about vba or vb,so plz help me.
i will be thankful
bye

waqas ali saif
 
Old August 18th, 2003, 09:28 AM
Authorized User
 
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do an "After Update" sub that based on the selection of the combo box, goes out and grabs that last seriel number from the recordset and adds 1 to it, and then update the serial # field.

Like this....

Dim rec as recordset
dim intSer as integer

currentdb().rec("yourtable")

rec.movelast
intSer = rec.Fields("Serial #")

me.txtbox = intSer + 1 'this is the box you want to update


I hope this helps

John









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