Adding Multiple Records

  • Thread starter Thread starter ParrotGirl
  • Start date Start date
P

ParrotGirl

Lets Try This Again
I am creating a service database. and I need some help on adding multiple
records automatically. Currently, I can do one at a time, but i would like
to be able to update multiple records with just 1 click

This is what I have now

Private Sub CmdAddPoolCare_Click()

DoCmd.GoToRecord , , acNewRec
If Me.NewRecord Then
Me.ServDate = DMax("ServDate", "SERVICE TABLE") + 7

End If

End Sub
The question I want to ask is
If Complete= True and [JobTable].[PoolCareEnd] is null (job is still on
active pool care) then

DoCmd.GoToRecord , , acNewRec
If Me.NewRecord Then
Me.ServDate = DMax("ServDate", "SERVICE TABLE") + 7

If Complete= False and [JobTable].[PoolCareEnd] is null (job is still on
active pool care) then do nothing or If Complete= True and
[JobTable].[PoolCareEnd] is not null(job is no longer on active pool care)
then do nothing
I want to be able to click complete on a continuous form and update all
records at one time.
any advise
 
On Tue, 22 Jan 2008 18:21:25 -0800, ParrotGirl

It's not crystal clear to me what you want, but it sounds like you
want to click a button and update a bunch of records all at the same
time.
Yes, you can do that, with an Update query.
For example:
update tblProducts
set Price = Price * 1.03
where CategoryID = 5
This would update all products in category 5.
Create the query, then execute it using:
CurrentDb.Execute "yourQuery", dbFailOnError

-Tom.
 
Back
Top