exempting "2222"

  • Thread starter Thread starter Haggr1 via AccessMonster.com
  • Start date Start date
H

Haggr1 via AccessMonster.com

the procedure below works. But I would like to exempt "2222"

Private Sub Job_Number_BeforeUpdate(Cancel As Integer)
If DCount("*", "Table1", "[Job Number]=" & Me.Job_Number & _
" AND [Date To]>Date()-10") = 0 Then
MsgBox "NOT A VALID JOB NUMBER" & vbNewLine _
& " SEE SHOP MANAGER"
Cancel = True
Me.Job_Number.Undo
End If
 
What would 2222 be: a Job Number?

Private Sub Job_Number_BeforeUpdate(Cancel As Integer)
If Nz(Me.Job_Number, "") <> "2222" Then
If DCount("*", "Table1", "[Job Number]=" & Me.Job_Number & _
" AND [Date To]>Date()-10") = 0 Then
MsgBox "NOT A VALID JOB NUMBER" & vbNewLine _
& " SEE SHOP MANAGER"
Cancel = True
Me.Job_Number.Undo
End If
Else
MsgBox "SORRY: CAN'T USE THAT JOB NUMBER" & vbNewLine _
& " SEE SHOP MANAGER"
Cancel = True
Me.Job_Number.Undo
End If
End Sub
 
That works but know I find I need more help.

Using that same ("me.job_number") I need to know if [table1].[settercompany]
for the last 10 days = (me.settercompany) using ([table1].[date from]) The
same msgBox would still work

Here is my [table1]

[job number] [settercompany] [date to] [date from] [amount]
What would 2222 be: a Job Number?

Private Sub Job_Number_BeforeUpdate(Cancel As Integer)
If Nz(Me.Job_Number, "") <> "2222" Then
If DCount("*", "Table1", "[Job Number]=" & Me.Job_Number & _
" AND [Date To]>Date()-10") = 0 Then
MsgBox "NOT A VALID JOB NUMBER" & vbNewLine _
& " SEE SHOP MANAGER"
Cancel = True
Me.Job_Number.Undo
End If
Else
MsgBox "SORRY: CAN'T USE THAT JOB NUMBER" & vbNewLine _
& " SEE SHOP MANAGER"
Cancel = True
Me.Job_Number.Undo
End If
End Sub
the procedure below works. But I would like to exempt "2222"
[quoted text clipped - 6 lines]
Me.Job_Number.Undo
End If
 
I'm sorry, I don't understand what you're asking for.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Haggr1 via AccessMonster.com said:
That works but know I find I need more help.

Using that same ("me.job_number") I need to know if
[table1].[settercompany]
for the last 10 days = (me.settercompany) using ([table1].[date from])
The
same msgBox would still work

Here is my [table1]

[job number] [settercompany] [date to] [date from] [amount]
What would 2222 be: a Job Number?

Private Sub Job_Number_BeforeUpdate(Cancel As Integer)
If Nz(Me.Job_Number, "") <> "2222" Then
If DCount("*", "Table1", "[Job Number]=" & Me.Job_Number & _
" AND [Date To]>Date()-10") = 0 Then
MsgBox "NOT A VALID JOB NUMBER" & vbNewLine _
& " SEE SHOP MANAGER"
Cancel = True
Me.Job_Number.Undo
End If
Else
MsgBox "SORRY: CAN'T USE THAT JOB NUMBER" & vbNewLine _
& " SEE SHOP MANAGER"
Cancel = True
Me.Job_Number.Undo
End If
End Sub
the procedure below works. But I would like to exempt "2222"
[quoted text clipped - 6 lines]
Me.Job_Number.Undo
End If
 
where you helped me verify valid job numbers during Billing. I also find I
need to verfiy that the job came from the customer I am going to bill it to.


Here is how job flows through my shop

I recieve a job. I scan it to my "Table1"
[job number] [settercompany] [date from]

I scan that job to a worker
[job number] [settercompany] [date to]

when job is done the Bill it to me
[job number] [settercompany] [date from] [amonut]

I bill the customer
[job number] [settercompany] [date to] [amount]


What you did keeps my worker from scanning invalid job numbers

What I am asking it to make sure I billing those job to the correct company
that gave them to me it the first place.

Thanks



I'm sorry, I don't understand what you're asking for.
That works but know I find I need more help.
[quoted text clipped - 32 lines]
 
I'm sorry, I still don't understand.

Are you saying that you're storing the data redundantly in multiple tables?
That's never a good idea.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Haggr1 via AccessMonster.com said:
where you helped me verify valid job numbers during Billing. I also find
I
need to verfiy that the job came from the customer I am going to bill it
to.


Here is how job flows through my shop

I recieve a job. I scan it to my "Table1"
[job number] [settercompany] [date from]

I scan that job to a worker
[job number] [settercompany] [date to]

when job is done the Bill it to me
[job number] [settercompany] [date from] [amonut]

I bill the customer
[job number] [settercompany] [date to] [amount]


What you did keeps my worker from scanning invalid job numbers

What I am asking it to make sure I billing those job to the correct
company
that gave them to me it the first place.

Thanks



I'm sorry, I don't understand what you're asking for.
That works but know I find I need more help.
[quoted text clipped - 32 lines]
Me.Job_Number.Undo
End If
 
those five fields are in one table call [table1]

I do wish however I would have used IDs for [settercompany] becouse they
always repeat will first an last name. Too many queries ago to change now.
Douglas said:
I'm sorry, I still don't understand.

Are you saying that you're storing the data redundantly in multiple tables?
That's never a good idea.
where you helped me verify valid job numbers during Billing. I also find
I
[quoted text clipped - 30 lines]
 
Back
Top