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 / Forms Programming / November 2005

Tip: Looking for answers? Try searching our database.

Add multiple new records?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ptlm65 - 30 Nov 2005 15:54 GMT
I am trying to add many new records at once.

What I need is to enter about 25 invoice numbers at once and thos
invoice numbers are linked to one employee. Is this possible? Pleas
help. Thank you

--
ptlm65Posted from - http://www.officehelp.i
Klatuu - 30 Nov 2005 16:10 GMT
I am assuming you have an employee table and a related invoice table.  If you
don't, you should.  Then you need a form with a subform.  The form should be
a single record form with the employee table or a query on that table as the
record source.  The subform should be based on the invoice table or a query
on that table.

> I am trying to add many new records at once.
>
> What I need is to enter about 25 invoice numbers at once and those
> invoice numbers are linked to one employee. Is this possible? Please
> help. Thank you.
ptlm65 - 30 Nov 2005 17:14 GMT
Thanks I will create a subform based on the invoice table. Is i
possible for a user to enter several invoice #'s at once withou
entering one at a time? For instance entering invoice # 22 thru 45
without having to manually enter one at a time,  linked to employee Mr
Smith.

Klatuu Wrote:
> I am assuming you have an employee table and a related invoice table.
> If you
[quoted text clipped - 14 lines]
> > --
> > ptlm65Posted from - http://www.officehelp.in

--
ptlm65Posted from - http://www.officehelp.i
Klatuu - 30 Nov 2005 18:51 GMT
Yes, it is possible, but would take some coding to accomplish it.  The code
would be in the form, not the sub form.  You could provide two text boxes -
one for the from number and one from the to number.  The a command button to
add the records.  It might go something like this (untested air code):

Dim lngFrom as Long
Dim lngTo as Long
Dim lngCounter as Long
Dim dbf as Database
Dim rst as Recordset

   Set dbf = CurrentDb
   Set rst = CurrentDb.OpenRecordset("InvoiceTable", dbOpenDynaset)
   lngFrom = Me.txtFromNumber
   lngTo = Me.txtToNumber

   For lngCounter = lngFrom To lngTo
       With rst
           .AddNew
           ![Client_Code] = Me.txtClientCode
           ![Invoice_No- = lngCounter '<- May need to think about data type
here
           'If you need to populate other fields and have the data, they
could go here
           .Update
       End With
   Next LngCounter

   rst.Close
   Set rst = Notihing
   Se dbf = Nothing

> Thanks I will create a subform based on the invoice table. Is it
> possible for a user to enter several invoice #'s at once without
[quoted text clipped - 21 lines]
> > > --
> > > ptlm65Posted from - http://www.officehelp.in
 
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



©2008 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.