Someone help me!

F

fi.or.jp.de

Hi All,

I have userform in excel to search & get data from Access database.

I need to update some values from excel to access.

Right now i am using this code

txt1 = trim(userform1.textbox1.value)
txt2 = Trim(userform1.textbox2.value) ( This is Auto generated number
in Access table )

sSQL = "UPDATE table1 SET table1.[account number] = " & txt1
sSQL = sSQL & " WHERE ID= " & txt2

Similarly I have lot of Textbox and combo box

I don't want to create
if textbox1.value <> "" then perform this operation
elseif do something
elseif do more....
end if

Please help in providing single sql statement which solve all the
queries.

Thanks in advance.
 
J

JLGWhiz

When posting, your subject line should reflect the topic that you are having
a problem with. That way, those who have expertise in that area will be
more inclined to respond.

I do not have expertise in SQL, so I will leave you with the above advice.
 
P

Patrick Molloy

so you want to loop through the textbox controls - creating SQL when the
value isn't "" ie not empty?
difficult, since you're using txt1 and txt2. we don't know your
relationships with textboxes and comboboxes

my immediate response was to do a FOR EACH ctrl in Me.Controls / NEXT loop
and where the control was a textbox, test it.
however, not understanding the relationships prevents this
 

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