Need help with Recordset

Hello,

I need help with a form that I'm trying to make with access and it keeps getting stuck in some details I don't get.

I have a text box named CodClient and I want to write there a number and using that number to retrieve from the database some information. You can see the code I've written below. I included it in the CodClient_OnChange() event and the input boxes are only for testing purpose. I can see the value for CodClient just like I entered it in the text box in the first input box but in the actual recordset I get nothing but an error that states a missing value in the fields. What can I do? How can I get
rst.Open "Select * from Scadentar where Scadentar.[CodClient]= CodClient.Text", conn, adOpenStatic
to recognize the CodClient value I have entered so I can have access to the table fields I need?

Please Help!

Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset

Set conn = CurrentProject.Connection
Set rst = New ADODB.Recordset

factNo = InputBox("What is the name of the company?", "Company Request", CodClient.Text)

rst.Open "Select * from Scadentar where Scadentar.[CodClient]= CodClient.Text", conn, adOpenStatic

factNo = InputBox("What is the name of the company?", "Company Request", rst.Fields("NumeClient").Value)


Thanks!

Comments

  • Hello - new problem - old one i have managed it

    I have a problem with trying when I open a form that shows fields from a table (is linked tot he table fields) not to show any information in the fields. I want them to be blank at first, after to be able so search something and see the specific field information. I don't want from the start to see the first record information in the fields.

    Can someone help?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion