Adding data to a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some VBA calculations performed before using udate method to add
records to a table ordered by year. 90% of the time the program is run, the
records add properly. Occassionaly, they are out of order. There is nothing
consistent about the order or how many runs before malfunction. It seems
impossible to me. Any ideas.

Thanks
 
Access tables do not have an "order' ...so your question is confusing..you
can run a query against a table and the query can have an "order" if you so
specify.


Bob
 
Listed below is the code I used to make the table. Perhaps this will help
clarify.

updstring = "Select * FROM MultiDayTable ORDER BY [Water_Year]"
'Establishes receiving table
Set myupd = mydb.OpenRecordset(updstring) 'Connects to receiving table

myupd.AddNew 'This routine adds records to receiving Table
myupd!Water_Year = WatYr
myupd!Sensor_ID = GageNum
'myupd!fulldate = fulldate
myupd!oneday = Format(nextdayrain(0), "###.00")
myupd!twodays = Format(nextdayrain(1), "###.00")
myupd!threedays = Format(nextdayrain(2), "###.00")
myupd!fourdays = Format(nextdayrain(3), "###.00")
myupd!fivedays = Format(nextdayrain(4), "###.00")
myupd!sixdays = Format(nextdayrain(5), "###.00")
myupd!eightdays = Format(nextdayrain(6), "###.00")
myupd!tendays = Format(nextdayrain(7), "###.00")
myupd!fifteendays = Format(nextdayrain(8), "###.00")
myupd!thirtydays = Format(nextdayrain(9), "###.00")
myupd!sixtydays = Format(nextdayrain(10), "###.00")
myupd!oneyear = Format(nextdayrain(11), "###.00")

myupd.Update 'Adds new data to MultiDayTable
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top