Update access database through excel

T

tinybears

Hey can someone help me with forming a code. I have some userforms in
Excel and an access database. I want:

If Ticker already available in database(access) (help with this
please)
Messagebox("Already available")
if Yes then
Messagebox("Do you want to overwrite the data?", VbYesNo)
if yes then
'delete the records and write back the new records(help
with this please)
else unload Userform
end if
else 'my regular code
else
'my regular code
end if

thx a lot. I'm becoming desperate with this problem.
If someone needs my code I'm glad to send you my whole workbook. It's a
workbook for forming financial ratio's for stocks and also graphs and
such.

thx
 
D

Douglas J Steele

Are you saying that you're wanting to do this in your Excel application? If
so, I'd suggest asking in a newsgroup related to Excel, such as
microsoft.public.excel.programming
 
T

tinybears

In my VBA code in Excel. In the Excel group I got the answer that I
should ask it here lol.
 
D

Douglas J Steele

Odd, since you're programming in Excel and not even using Access (you're
using Jet, the database engine)

Normal way to determine whether a particular piece of data exists in the
database is to create a recordset that returns information to your program.
Since you're going against a Jet database, using DAO in your Excel
application makes the most sense (DAO was developed specifically for use
with Jet databases), although you could use ADO if you prefer.

Without knowing anything about your tables, it's not possible to give you a
more specific answer.
 

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

Top