I apologize in advance for the x-post, but I am really not sure where
this would best be addressed.
I am designing a database in MSAccess for which I want to make the
front-end in VB.
I have planned out the basic structure of the tables and fields.
However, my experience with Access is limited to doing all the work
within Access, so I have a couple of issues I'm confused about.
1) Relationships: If I want a One-to-Many relationship between two
tables based on an ID number, in Access I used the auto-number feature
and then used the lookup feature in the other table, and viola, that's
all there was to it.
In Visual Basic, will I have to maintain the relationship on my own?
Does the Access database under the application respond with an error
if there's a problem, or what?
2) I am going to be assigning a value to a table's ID field. I am
going to want to take a set of predetermined factors to generate part
of the number, and then I want the last two digits to be an increment
from the most recent entry. How is my VB form going to check to see if
this ID is unique before writing it to the database?
In this instance I can give a specific example:
InvoiceID field - Indexed, no duplicates.
This number will be a representation of the YY,MM,DD + xx where xx
will simply be incremented for each item added on that day.
Eg: Today if I generate 3 invoices, they will be assigned the IDs:
031230-01, 031230-02, 031230-03. Would I simply lookup the last number
that matches the current date and then increment by one?
I know this is a lot.. it's just my first time coding a VB app with an
Access database with relationships and ID numbers.
Thanks for any advice you can give me.
---Atreju---