A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding new record to non-auto key field



 
 
Thread Tools Display Modes
  #1  
Old January 24th, 2010, 04:20 PM posted to microsoft.public.access.forms
Gilbert 2097
external usenet poster
 
Posts: 19
Default 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  
Old January 24th, 2010, 10:25 PM posted to microsoft.public.access.forms
Tom Wickerath
external usenet poster
 
Posts: 3,914
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.