Form Validation (Experts Needed)

Tinny

Registered User.
Local time
Yesterday, 22:25
Joined
Oct 29, 2006
Messages
20
Hello everyone… I am a VBA newbie and I wonder how can I do this…hard form me but easy for experts. I really need help because it’s left me 7 days before I’ll go to army and I have to finish this project...





Validation.jpg

In my form i want to use these 2 cases
So i need a VBA Validation

Case 1= Payment and Credit enable (From To Debit Disable)
Case 1 = From To Debit enable (Payment and Credit Disable)

Thanks :)
 
Last edited:
Try a combo box or an option group , whichever looks better, to select whether you are doing a sale (debit) or refund(credit) Then in the after update action of whichever control you choose

do

textbox1.enabled = true/false, or even textbox1.visible=true/false
etc

to get the appearance you want. You may need also to clear the values for the hidden/disabled boxes.

You will probably also need an onopen event to set an initial state for the form.

Hope this helps
 
Code:
Private Sub EnableMe()
    If Payment Then 
        Me.Payment.Enabled = True
        Me.Credit.Enabled = True
        
    Else
        Me.From .Enabled = False
        Me.To.Enabled= False
        Me.OK.Debit= False
    End If

If From Then 
        Me.From .Enabled = True
        Me.To.Enabled = True
       Me.Debit.Enabled = True

        
    Else
        Me.Payment .Enabled = False
        Me.Credit .Enabled= False
    
End If


End Sub
I find something..Is that Right?
 

Users who are viewing this thread

Back
Top Bottom