Posted on 1997-10-31
I'm using Visual Basic 4. My project contains 2 forms. Form 1 has a button and a check box. Form 2 has few text boxes and a data control. My access file contain 2 queries. I have made the necessary links between the text boxes, my database and the data control.
Note: I have set the RecordSource of my datacontrol in from2 to query2. And my check box in form1 is checked by default.
I am trying to write a code that will show form2 and display the information in query1 when I click the Button on form1 without ticking the check box, however if the check box was ticked then the test boxes in form2 should display information from query2. This is the code I have written in the button command1_click:
If Check1.Value = 1 Then
Form2.Data1.RecordSource = query2
Form1.Data1.RecordSource = query1
But it doesn't work, I keep getting information from query2 displayed wethear the check box was ticked or not despite the the 'Else' condition I have set in my code. Can anyone tell me why won't it work? Many Thanx!
Your help is appreciated