wasim_sono
01-24-2007, 11:28 PM
Dear All
I m facing problem to check criteria on another field. Lets start here.
Fields name:
=========
Zone (data accepts as 01, 02, 03, ......21)
Series ( data accepts as 1000, 2000, 3000, 4000, 5000, 6000,....9000)
......
.....
Amount
Ac1 (data accepts as 301, 302, 303,.......319)
Ac2 (data accepts as 301, 302, 303,.......319)
Ac3 (data accepts as 301, 302, 303,.......319)
Ac4 (data accepts as 301, 302, 303,.......319)
Ac5 (data accepts as 301, 302, 303,.......319)
Ac6 (data accepts as 301, 302, 303,.......319)
tab order:
======
1=Zone, 2=Series, .........16=Ac1, 17=Ac2....
Criteria checking:
============
If Series = 1000 then Ac1=301 or 302 only
if series = 2000 then ac1=301 or 303 or 305 only
if sereis = 3000 then ac1 = 302 or 304 or 310 or 305 only
.......
......
.....
I used the following code on after update event of AC1 as under:
Private Sub AC1_AfterUpdate()
Dim Series As String
Series = Me.SER.Value
' Me.SER.SetFocus
If Me.SER.Text = "1000" Then
Me.AC1.DefaultValue = "301" Or "302" Or "303" Or "319"
'If Me.AC1.Text <> "301" Or "302" Or "303" Or "319" Then
MsgBox "Code is incorrect"
End If
' ElseIf Series = 4000 Then
'Me.AC1.Text = 301 Or 310
'End If
End Sub
but I got the following run time error message.
Run-time error '2185'
You can't reference a property or method for a control unless the control has the focus.
for this I use the following code
' Me.SER.SetFocus
but still not getting the result.
any one can help me.
Thanks in advance.
I m facing problem to check criteria on another field. Lets start here.
Fields name:
=========
Zone (data accepts as 01, 02, 03, ......21)
Series ( data accepts as 1000, 2000, 3000, 4000, 5000, 6000,....9000)
......
.....
Amount
Ac1 (data accepts as 301, 302, 303,.......319)
Ac2 (data accepts as 301, 302, 303,.......319)
Ac3 (data accepts as 301, 302, 303,.......319)
Ac4 (data accepts as 301, 302, 303,.......319)
Ac5 (data accepts as 301, 302, 303,.......319)
Ac6 (data accepts as 301, 302, 303,.......319)
tab order:
======
1=Zone, 2=Series, .........16=Ac1, 17=Ac2....
Criteria checking:
============
If Series = 1000 then Ac1=301 or 302 only
if series = 2000 then ac1=301 or 303 or 305 only
if sereis = 3000 then ac1 = 302 or 304 or 310 or 305 only
.......
......
.....
I used the following code on after update event of AC1 as under:
Private Sub AC1_AfterUpdate()
Dim Series As String
Series = Me.SER.Value
' Me.SER.SetFocus
If Me.SER.Text = "1000" Then
Me.AC1.DefaultValue = "301" Or "302" Or "303" Or "319"
'If Me.AC1.Text <> "301" Or "302" Or "303" Or "319" Then
MsgBox "Code is incorrect"
End If
' ElseIf Series = 4000 Then
'Me.AC1.Text = 301 Or 310
'End If
End Sub
but I got the following run time error message.
Run-time error '2185'
You can't reference a property or method for a control unless the control has the focus.
for this I use the following code
' Me.SER.SetFocus
but still not getting the result.
any one can help me.
Thanks in advance.