Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with refreshing table? 1

Status
Not open for further replies.

seawave

Technical User
Oct 21, 2002
30
US
I have an existing table where the data is not current.
I want to "refresh" or update the existing table with a
new Excel spreadsheet that has the most current information.

The fields are the same. I just want to be able to add the
new rows of information to the existing table.

Any help on how to do this would be greatly appreciated.

Thanks.
 
well you could have a buttont that updates the tables or run a program on the opening of the db...i prefer the second option as it does not take user intervention to pick up the new data...

what i do is have a form that opens on startup...then in the on open event i code to open the excel file, find the new rows of data, (i usually store the last rows id or some other unique detail pertaining to the row in a db table so i can quickly find the new data) then loop through and import the data

hth Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Bastien,
Could you give me an example of how to code the on open
event?
I do appreciate your help. I'm new to using coding.
Most of my Access knowledge in "coding" is with macros.

Thank you.
Seawave
 
i used the switchboard in this application:

Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

'update the tables for renewals and lasped subscriptions
Call mdlBasic.DoUpdate
' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

End Sub

then i have a module coded in VBA(visual basic) to open the in this case, the same database and do some work on it, you would need to use ADO to open the excel sheet and find the data

i found

and
to be very good resources this type of thing...also search here for more code sample to access the data in the worksheets...

hth Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Bastien,
Thank you for your help. I will also check out the web sites you suggested.

Again, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top