using vba to update record in another table

  • Follow


I am new to VBA, but here is what i want to accomplish.
I have 1 form and 2 tables.

Form uses table 1 to store data (first,last,address,tel.site (a), sit (b) 
eash site has a unique number..)

Table 2 stores site information and unique number( range number for site (a) 
is 1 to 1000 range for site (b) 1000 to 4000).
How do i increment the number by one  every time a new record is added to a 
site. For example first record is site (a) is 1000, next time i add a record 
for site(a) number must be 10002 and same for site (b).

Please help thanks
  
0
Reply Utf 2/27/2007 3:31:00 AM

Hey learner,

You would need to decide where you wanted to place this to get it to
increment by one by this should work for you.

Nz(DMax("[NameOfField]", "NameOfTable", ""), 0) + 1

HTH,
Shane

learner wrote:
>I am new to VBA, but here is what i want to accomplish.
>I have 1 form and 2 tables.
>
>Form uses table 1 to store data (first,last,address,tel.site (a), sit (b) 
>eash site has a unique number..)
>
>Table 2 stores site information and unique number( range number for site (a) 
>is 1 to 1000 range for site (b) 1000 to 4000).
>How do i increment the number by one  every time a new record is added to a 
>site. For example first record is site (a) is 1000, next time i add a record 
>for site(a) number must be 10002 and same for site (b).
>
>Please help thanks

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200702/1

0
Reply shanesullaway 2/27/2007 5:48:16 AM


1 Replies
978 Views

(page loaded in 0.101 seconds)

Similiar Articles:
















7/19/2012 7:19:09 PM


Reply: