Hi all,
I am self taught on Access so I apologise if the answer is simple. I do feel like there is something simple I am overlooking.
I am trying to add more part numbers for one particular supplier (account_ref). This is the only supplier (ARB20) I may require more than one part number on.
What I am trying to say is once "Part_Number" has been entered, prompt me if I want to add another part number BUT only prompt when "Account_Ref" = "ARB20".
Then if answer=yes make "Part_Number_2" visible.
If answer=no then do nothing.
This works when I enter it all on an existing record with Account_Ref = ARB20
However when I then go to the next record where Account_Ref DOES NOT = ARB20 , Part_Number_2 is visible. How do I stop it being visible on this other record?
Here's my code:
Private Sub Part_Number_AfterUpdate()
If Me.Account_Ref = "ARB20" Then
Dim answer As String
answer = MsgBox("Do you need to enter another part number?", vbYesNo, "Another Part Number?")
If answer = vbNo Then
'donothing
Else
Me.Part_Number_2.Visible = True
End If
End Sub
Private Sub Part_Number_2_AfterUpdate()
If Me.Account_Ref = "ARB20" Then
Dim answer As String
answer = MsgBox("Do you need to enter another part number?", vbYesNo, "Another Part Number?")
If answer = vbNo Then
'donothing
Else
Me.Part_Number_3.Visible = True
End If
End Sub
Private Sub Part_Number_3_AfterUpdate()
If Me.Account_Ref = "ARB20" Then
Dim answer As String
answer = MsgBox("Do you need to enter another part number?", vbYesNo, "Another Part Number?")
If answer = vbNo Then
'donothing
Else
Me.Part_Number_4.Visible = True
End If
End Sub
Any suggestions are much appreciated and thank you in advance.
I am self taught on Access so I apologise if the answer is simple. I do feel like there is something simple I am overlooking.
I am trying to add more part numbers for one particular supplier (account_ref). This is the only supplier (ARB20) I may require more than one part number on.
What I am trying to say is once "Part_Number" has been entered, prompt me if I want to add another part number BUT only prompt when "Account_Ref" = "ARB20".
Then if answer=yes make "Part_Number_2" visible.
If answer=no then do nothing.
This works when I enter it all on an existing record with Account_Ref = ARB20
However when I then go to the next record where Account_Ref DOES NOT = ARB20 , Part_Number_2 is visible. How do I stop it being visible on this other record?
Here's my code:
Private Sub Part_Number_AfterUpdate()
If Me.Account_Ref = "ARB20" Then
Dim answer As String
answer = MsgBox("Do you need to enter another part number?", vbYesNo, "Another Part Number?")
If answer = vbNo Then
'donothing
Else
Me.Part_Number_2.Visible = True
End If
End Sub
Private Sub Part_Number_2_AfterUpdate()
If Me.Account_Ref = "ARB20" Then
Dim answer As String
answer = MsgBox("Do you need to enter another part number?", vbYesNo, "Another Part Number?")
If answer = vbNo Then
'donothing
Else
Me.Part_Number_3.Visible = True
End If
End Sub
Private Sub Part_Number_3_AfterUpdate()
If Me.Account_Ref = "ARB20" Then
Dim answer As String
answer = MsgBox("Do you need to enter another part number?", vbYesNo, "Another Part Number?")
If answer = vbNo Then
'donothing
Else
Me.Part_Number_4.Visible = True
End If
End Sub
Any suggestions are much appreciated and thank you in advance.