G
Graffyn
I'm programming with SQL and can't seem how to figure out how to send more
than one record to the table with one form.
than one record to the table with one form.
Graffyn said:Sorry for the massive posts... I was told to take on a job I have no
experience with the language... i found this:
Dim strSQL As String
Dim intCount As Integer
For intCount = 1 To Me![txtNumberofRecs]
strSQL = "INSERT INTO table (field1, field2, etc.) "
strSQL = strSQL & "VALUES(" & Me!TissueNumber & ", "
strSQL = strSQL & Me!field2 & ", etc.);"
DoCmd.RunSQL strSQL
Next intCount
This code looks like it will do what i want. Create a access table with
all
the entries from the form inputed. Lets say we start out with two
entries.
A Date the person worked and their Social. I have a form with two entries
for social security numbers. This is the code I'm working with now:
im strSQL As String
Dim intCount As Integer
For intCount = 1 To 2
strSQL = "INSERT INTO PayrollTable (Date, SSN) VALUES ( & Me!DateField &
Me!SSN(intCount) )"
DoCmd.RunSQL strSQL
Next intCount
Jeff Boyce said:I'm sorry if I sound like a broken record ...
"making a database", by itself, is worthless ... having a database (a set
of
data stored somewhere) only provides work for the person who designs the
database.
Having a way to report payroll to the CEO, by month, is a business need.
"easier data entry" is, by itself, worthless ... unless you ALSO have
some
way of getting the data back out and doing something with it.
I really am looking for a better idea of what having easier data entry
and a
database (apparently payroll-related) will let you do.
If you only need to recreate a payroll form, you are taking on a
tremendous
learning curve trying to force it into a relational database.
If you entered data on an Excel spreadsheet, you'd simply save the file
...
THAT is a database, of sorts. What is it that you want to DO with the
data?
Regards
Jeff Boyce
Microsoft Office/Access MVP