Control code using a text box

  • Thread starter Thread starter Stephen sjw_ost
  • Start date Start date
S

Stephen sjw_ost

Hello again. I need some assistance please.

Can anyone show me how I can make the code below pull the path it needs from
a text box value? I want the path, H:\.......\XXX.mdb, to be pulled from a
text box that would be in a form.

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= H:\Shortcuts&Links\M
Y P R O J E C T S\MISC\IDAUser.mdb;User Id=admin;Password=;"

If you need any more of the code, please let me know.

Thank you very much for any assistance.
Stephen.
 
the Open argument is just a string value. in VBA, you should be able to
concatenate multiple strings to get the final string value needed for an
argument, or for anything else you're doing. the example below assumes that
the name of the textbox control is txtPath, and that the code is running in
the same form that holds the control:

cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& Me!txtPath & ";User Id=admin;Password=;"

hth
 
Tina,

Thank you very much! That worked perfectly!
Thank you for the explaination as well. I beleive I understand what was
going on much better now. You ROCK!

Stephen.
 
you're very welcome :)


Stephen sjw_ost said:
Tina,

Thank you very much! That worked perfectly!
Thank you for the explaination as well. I beleive I understand what was
going on much better now. You ROCK!

Stephen.
 
Back
Top