DoCmd.OpenForm

  • Thread starter Alejandro González Anselmi
  • Start date
A

Alejandro González Anselmi

Hi
I have an access fe application with several forms on one form
I call another form using the
DoCmd.OpenForm formName, , ,condition
where condition contains something like id=x
it works perfect

Now, I have migrated the db to SQL keeping the front end application on
access
If I try to execute the same statement it does nothing,
doesn't even pass trough the load sub from the form

any suggestions
Thanks
alejandro
 
6

'69 Camaro

Hi, Alejandro.

Check the data type of the ID field in the table in SQL Server. If it's now
equivalent to a string data type (char, varchar, et cetera), whereas it used
to be a numerical data type in Access, then you'll need to change the syntax
of your WHERE condition. (The syntax you show in your message indicates it
was originally a numerical data type in Access.) Either that or change the
data type in SQL Server to indicate a numerical data type.

And you won't get an error message while running your VBA procedure if
you're using "On Error Resume Next" so you'll be oblivious if an error
occurs when opening the form, which may explain why you mentioned "If I try
to execute the same statement it does nothing."

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
V

Van T. Dinh

Assuming you are talking about an Access Database (MDB / MDE file format),
check the linked Tables that are being use as the RecordSource of the Form.

Can you access/see the data in the DatasheetView of the linked Tables?

HTH
Van T. Dinh
MVP (Access)
 
Top