Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I'm very new to Access and to any kind of coding so I'm not sure how to do this or if its even possible. I have a form with a combo box and a text box. The combo box is set so that I can choose two different options "Type1" and "Type2". I then have two tables with stock numbers relating to each "Type1" and "Type2". I want the text box's value to be auto-filled from the next available stock number on the type's corresponding table. So if I choose "Type1" the text box fills with a number from the "Type1Stock#" table, and that number should be the next available that hasn't been used before. I can't use the autonumbers as these stock numbers are given by a vendor. Any idea on how to accomplish this? Thanks for any help

What I have tried:

I don't even know how to start
Posted
Comments
RedDk 14-May-18 13:33pm    
VBA?
chadzilla57 14-May-18 17:24pm    
I'm ok with doing it however is suggested. I think I know enough coding to follow some suggested formats
RedDk 14-May-18 18:40pm    
See here:
https://developer.microsoft.com/en-us/access/gallery/?filterBy=Access

Pick something, try something ... find something there which looks like what you're trying to do with this third-party data ...

On the Access menu ribbon tab "Database Tools" then click-on "Visual Basic". This action will bring up the interface where you can work on code. Be sure to make "Object Browser" visible. If there is any code in the database that is VBA, the references to the libraries used will be displayed there.
RedDk 14-May-18 18:55pm    
This one is huge:
http://www.worldbestlearningcenter.com/index_files/vba-examples-microsoft-access.htm
(this one in particular: http://www.worldbestlearningcenter.com/index_files/Access-if-else-statement-sql-vba.htm)
Haven't looked at any of them but the list seems to be comprehensive. Walking through things like this is the best way to learn how to use the features most effectively.
chadzilla57 15-May-18 10:13am    
Thanks! I'll check it out

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900