|
-
Jun 9th, 2007, 03:16 AM
#1
Thread Starter
Addicted Member
Database problem
Here's some code I'm using when using a data control in one of my apps:
vb Code:
Private Sub Data1_Validate(Action As Integer, Save As Integer)
'(check1 is bound to "used", a yes/no statement
If Check1.Value = vbChecked Then
Text1.Enabled = False
Text2.Enabled = False
Command1.Enabled = False
Else
Text1.Enabled = True
Text2.Enabled = True
Command1.Enabled = True
End If
End Sub
However, when I come up to an entry that has "used" as true (and therefore, has the checkbox ticked), nothing happens. But then, when I go to another entry, the code runs, leaving the textboxes and button disabled.
Any ideas on this will be thanked.
Last edited by ajames; Jun 9th, 2007 at 10:38 AM.
-
Jun 9th, 2007, 03:43 AM
#2
Re: Database problem
Validate event fires when you try to focus another control which has its causesvalidation property set to true.
-
Jun 9th, 2007, 07:36 AM
#3
Thread Starter
Addicted Member
Re: Database problem
So what would I need to do to get it to work how I want it to?
EDIT: Changed the strucure of the form, so the user must press a button to choose that data.
Last edited by ajames; Jun 9th, 2007 at 08:10 AM.
-
Jun 9th, 2007, 10:38 AM
#4
Thread Starter
Addicted Member
Re: Database problem
Unresolving this thread for a bit:
How would I make the data control automatically jump to another entry in the database?
For example, pressing a button would call entry 1, another 2 etc.
-
Jun 9th, 2007, 12:46 PM
#5
Re: Database problem
If pressing a button, youd then call the MoveNext or MovePrev method of the recordset... there are other considerations though, such as checking .BOF or .EOF before move, and forward only recordsets can't move backwards (MovePrev, MoveFirst)
-
Jun 9th, 2007, 01:54 PM
#6
Thread Starter
Addicted Member
Re: Database problem
I'm not entirely sure what a recordset is (thank vb6's help for not telling me anything remotely useful ), could you tell me how to create on? If not, is there a way of getting this to work with a data object only?
-
Jun 10th, 2007, 03:38 AM
#7
Re: Database problem
If you are using DAO (and I think you are) it is:
Code:
Dim rs As Recordset
-
Jun 10th, 2007, 05:13 AM
#8
Thread Starter
Addicted Member
Re: Database problem
Does that automatically make a recordset of the data object in the current form, or do you need more code to do that?
-
Jun 13th, 2007, 10:28 AM
#9
Thread Starter
Addicted Member
Re: Database problem
Bumped, as it vanished of the face of the forum. The does not bind to the data control unless it is given another command - help?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|