Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yes and No 2

Status
Not open for further replies.

EasyOnly

Technical User
Oct 11, 2008
55
US
Hi,

We have a table with the following fields:
deptserviceID: department providing the services
staffservicesID: staff name providing the services
PayDeptID: payment made to the department provided the services
PayStaffId:payment to staff providing the services.

Sometime the department and the staff providing the services are different than the one we pay for some reasons.

To process the payment:

I have payment request combo that I would like if you select any option from it, msgbox pop saying are you paying the same service provider for the services? If yes, then auto fill the following field
PayDeptID Combo, and PayStaffId combo from deptserviceID and staffservicesID. if the response is no, nothing happen the staff will have to pick from PayDeptID and PayStaffId.

Private Sub PaymentStatus_AfterUpdate()
Dim msg As Integer
Dim Response As Integer
MsgBox "Are you paying the same provider for the services", vbYesNo
If Response = vbYes Then
PayDeptID=
........




 
After reading your post, I had the following responses:
So, what's the problem?
That's good.
You have nice typemanship.
It's getting cold outside.

Get the point? You didn't ask any question.

So, I'm going to guess you would like to know how to create code to deal with the conditions mentioned. Here's some code you can play with to suit your needs:(shaid is the combobox)
Private Sub shaid_AfterUpdate()
Dim R As DAO.Recordset, RS As DAO.Recordset
Dim SQLText
Dim UserSelection
Set R = CurrentDb.OpenRecordset("Select * From [tblParcel] Where [Itemnumber] = " & Chr(34) & Me![shaid] & Chr(34))
If R.RecordCount = 0 Then
UserSelection = MsgBox("SHA Number Does Not Exit" & Chr(10) & "Add To Missing SHA Table?", vbYesNo)
Select Case UserSelection
Case 6
Set db = CurrentDb()
Set RS = db.OpenRecordset("Missing_SHA_Table", dbOpenDynaset)
RS.AddNew
RS![MMCNumber] = Forms![MMC_And_SHA_Update_Form]![MMCNumber]
RS![SHANumber] = Me![shaid]
RS![DateChecked] = Now()
RS![Reagtable] = Reaghold
RS.Update
RS.Close
db.Close
Set RS = Nothing
Set db = Nothing
Case 7
End Select
Me![shaid] = Null
Else
SQLText = "Select * From [tblParcel] Where [Itemnumber] = " & Chr(34) & Me![shaid] & Chr(34)
Forms![MainREAGform3].RecordSource = SQLText
Me![shaid] = Null
End If
End Sub

Notice I'm using 6 and 7 for the Yes and No.

Now if that's not what you are looking for, then post an appropriate question.
 

How about something like this?
Code:
Private Sub PaymentStatus_AfterUpdate()
If MsgBox("Are you paying the same provider for the services", vbYesNo) = vbYes Then
    [i]Set your other fields here[/i]
End If

I thought the question was pretty much implied when you explained what you wanted your code to do.

Randy
 
:) It was a good story ha....

Sorry I was not very clear. I would like help with codes for the following:

I someome respond yes, I want the PayDeptID and PayStaffId to be filled using with the same deptserviceID and staffservicesID used. The same service provider will be paid. If the response is no, then nothing happens and the staff will have to choose from the combos.
 
Thank you very much. It worked the firstt time I did it. The only thing is that. The information will show if you click on the field.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top