Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Automatically Add Record to table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ParrotGirl - 21 Jan 2008 04:08 GMT
Hello,
I have created a weekly service database, and I am trying to automatically
add a record to a table.
Main Table:  JobID -
Service End -   Job is no longer on service.

Service Table - Links to JobID
ServiceID
Date
Completed y/n

I want my technician to open a form that shows all service items that are
not completed.  as they update what has been completed and that service end
is null, i would like a button that they press to add a new service record
and auto fill in service date (adding 1 week)
doing this manually is time consuming as we may have 100 or more services at
one time
thanks for any help
Chris
Jackie L - 21 Jan 2008 18:18 GMT
It sould like you just need to add a button to go to a new record with code
like the following:

DoCmd.GoToRecord , , acNewRec
Me.ServiceDate = DateAdd("d", 7, Date)

Hope this helps.
Jackie

> Hello,
> I have created a weekly service database, and I am trying to automatically
[quoted text clipped - 15 lines]
> thanks for any help
> Chris
ParrotGirl - 21 Jan 2008 19:54 GMT
I will try this, the button I understand and the date add also, just not
clear on adding 100 records, were the criteria is completed yes and service
end is null.
chris

> It sould like you just need to add a button to go to a new record with code
> like the following:
[quoted text clipped - 24 lines]
> > thanks for any help
> > Chris
ParrotGirl - 23 Jan 2008 00:03 GMT
This is what I have so far,  It works on one record at a time only.

Private Sub CmdAddPoolCare_Click()

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

End If

End Sub

I need to add this to the code

If Me.Completed = False  (pool care was not completed) (AND/OR)
If Me.[Job Table]. PoolCareDay = is not null (no longer on pool service)
Then  do nothing  (do not add record)

If Me.[SERVICE TABLE].[Completed] = True  and If Me.[Job Table]. PoolCareDay
= is null then add record

Also, how about a msg box that 1. Confirms that you want to add records, and
2. Gives you an account of how many you are changing.

As I Said before, my tech updates at least 100 jobs per week.  So is there
some place that I need to link JOB TABLE.JOBID  TO SERVICE TABLE.JOBID  when
it add’s new records?

> I will try this, the button I understand and the date add also, just not
> clear on adding 100 records, were the criteria is completed yes and service
[quoted text clipped - 29 lines]
> > > thanks for any help
> > > Chris
Jackie L - 23 Jan 2008 02:06 GMT
Since I am not sure on your data structure, you could use an Append Query if
you have the 100 services in a table, then have the date field added in the
query with the same expression as mentioned earlier.  Attach the running of
the Append query to a button like:

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryAppendQueryName"
DoCmd.SetWarnings True
Me.Requery

Hope this helps

> I will try this, the button I understand and the date add also, just not
> clear on adding 100 records, were the criteria is completed yes and service
[quoted text clipped - 29 lines]
> > > thanks for any help
> > > Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.