Jackpotgee
Registered User.
- Local time
- Today, 00:13
- Joined
- Jun 7, 2007
- Messages
- 27
Hi, i know there are about 700 posts on here regarding write conflicts but i have searched them all and cant get this to work.
Ive tried all sorts of save record functions but cant get this to work(Green).
It was working fine until i added the bits in red. These 3 queries update a field called referral code based on the information that is supplied in OrganisationSendingReferral.
The Macros update a different field also based on which firm is selected in OrganisationSendingReferral.
OrganisationSendingReferral is a combo box that runs on a query.
Hope this is enough! i am literally at my wits end!
Code:
Private Sub OrgansiationSendingReferral_AfterUpdate()
DoCmd.SetWarnings False
Dim stDocNameRec As String
Dim stDocNameSen As String
stDocNameRec = "Mcr_UpdateHQReceiving"
stDocNameSen = "Mcr_UpdateHQSending"
DoCmd.OpenQuery "Qry_ReferralCodeClear"
If [ToFrom/HS] = "F" Then GoTo Receiving
If [ToFrom/HS] = "T" Then GoTo Sending
Receiving:
If [HSOfficeReceivingReferral] Like "KPMG" Or [HSOfficeReceivingReferral] Like "HS*" Or [HSOfficeReceivingReferral] Like "*LLP" Or [HSOfficeReceivingReferral] Like "UBS" Or [HSOfficeReceivingReferral] Like "RBS" Or [HSOfficeReceivingReferral] Like "BNP*" Then GoTo Exit_HSOfficeReceivingReferral_AfterUpdate Else
[HSOfficeReceivingReferral] = StrCon ([HSOfficeReceivingReferral], vbProperCase)
Exit_HSOfficeReceivingReferral_AfterUpdate:
DoCmd.RunMacro stDocNameRec
Exit Sub
Sending:
If [OrgansiationSendingReferral] Like "KPMG" Or [OrgansiationSendingReferral] Like "HS*" Or [OrgansiationSendingReferral] Like "*LLP" Or [OrgansiationSendingReferral] Like "UBS" Or [OrgansiationSendingReferral] Like "RBS" Or [OrgansiationSendingReferral] Like "BNP*" Then GoTo Exit_OrgansiationSendingReferral_AfterUpdate Else
[OrgansiationSendingReferral] = StrConv([OrgansiationSendingReferral], vbProperCase)
Exit_OrgansiationSendingReferral_AfterUpdate:
DoCmd.RunCommand acCmdRefreshPage
DoCmd.RunMacro stDocNameSen
[COLOR="Red"] DoCmd.OpenQuery "Qry_ReferralCodeClear"
DoCmd.OpenQuery "Qry_ReferralCodeUpdate"
DoCmd.OpenQuery "Qry_ReferralCodeUpdateOther"[/COLOR]
[COLOR="SeaGreen"] DoCmd.RunCommand acCmdRefreshPage
DoCmd.RunCommand acCmdSaveRecord[/COLOR]
DoCmd.SetWarnings True
Exit Sub
Ive tried all sorts of save record functions but cant get this to work(Green).
It was working fine until i added the bits in red. These 3 queries update a field called referral code based on the information that is supplied in OrganisationSendingReferral.
The Macros update a different field also based on which firm is selected in OrganisationSendingReferral.
OrganisationSendingReferral is a combo box that runs on a query.
Hope this is enough! i am literally at my wits end!