If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding new record to non-auto key field
Hi all, I'm using Access03 - I'm making a claim each month for reimburs for
a feeding program. I enter the bills I've paid into a table in which I decided not to use an autonumber key field but the last day of each month called 'MonthID' (I use it as the key thruout). It is the last day of each month like 12/31/09. I made a form to enter the bill info - combo for vendor and txtbox for Inv #, inv date, etc. It is a continuous form and it brings up the bills I've entered by hand very nicely, but when I try to enter a new bill it updates a record to the table but doesn't pick up the MonthID field key. I don't want to have the user have to enter the date on every line for every bill. I know if it was an autonumber it would just put the next number in. My question is - at what time and how do you enter the Key field if it is not autonumb. I put a field on the form (invisible) and tried the before update event to put the MonthID info in but it doesn't work. I've tried a few other things that made sense to me but can't come up with anything. Even looked at the Northwind Dbase cause the customers table has a non-auto key also. Thanx for any help.... -- Gil |
#2
|
|||
|
|||
Adding new record to non-auto key field
Hi Gilbert,
See this example, from Roger's Access Library: http://www.rogersaccesslibrary.com/f...ts.asp?TID=395 Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ __________________________________________ "Gilbert 2097" wrote: Hi all, I'm using Access03 - I'm making a claim each month for reimburs for a feeding program. I enter the bills I've paid into a table in which I decided not to use an autonumber key field but the last day of each month called 'MonthID' (I use it as the key thruout). It is the last day of each month like 12/31/09. I made a form to enter the bill info - combo for vendor and txtbox for Inv #, inv date, etc. It is a continuous form and it brings up the bills I've entered by hand very nicely, but when I try to enter a new bill it updates a record to the table but doesn't pick up the MonthID field key. I don't want to have the user have to enter the date on every line for every bill. I know if it was an autonumber it would just put the next number in. My question is - at what time and how do you enter the Key field if it is not autonumb. I put a field on the form (invisible) and tried the before update event to put the MonthID info in but it doesn't work. I've tried a few other things that made sense to me but can't come up with anything. Even looked at the Northwind Dbase cause the customers table has a non-auto key also. Thanx for any help.... -- Gil |
Thread Tools | |
Display Modes | |
|
|