Dairy Farmer
Registered User.
- Local time
- Today, 22:53
- Joined
- Sep 23, 2010
- Messages
- 244
The DB has 2 BE's. One for each farm. Reason: replication is done using sneakerware. One farm doesn't edit the other's data.
The FE has duplicates of each form, just the references are different so as to use the correct BE. i.e. F_1_DateCheck and F_2_DateCheck.
I would like some help on the VB code side. I have part of the code listed below.
Is it possible to set Forms![F_1_DateCheck]![CIM] as FormDateCheckCIM at the start of the code. That way I don't have to go through the whole code and change the reference.
The FE has duplicates of each form, just the references are different so as to use the correct BE. i.e. F_1_DateCheck and F_2_DateCheck.
I would like some help on the VB code side. I have part of the code listed below.
Is it possible to set Forms![F_1_DateCheck]![CIM] as FormDateCheckCIM at the start of the code. That way I don't have to go through the whole code and change the reference.
Code:
[B]Current:[/B]Private Sub CowDairy_AfterUpdate()
If CIM > [COLOR="blue"]Forms![F_1_DateCheck]![CIM][/COLOR] Then
Beep
MsgBox "That is the most cows in milk on one day!", vbInformation, "CONGRATULATIONS"
[COLOR="blue"]Forms!F_1_DateCheck.CIM[/COLOR].Requery
End If
End Sub
[B]Possible?:[/B][COLOR="Blue"]Forms![F_1_DateCheck]![CIM][/COLOR] = [COLOR="Red"]FormDateCheckCIM[/COLOR]
'or in form2
'[COLOR="Blue"]Forms![F_2_DateCheck]![CIM][/COLOR] = [COLOR="Red"]FormDateCheckCIM[/COLOR]
Private Sub CowDairy_AfterUpdate()
If CIM > [COLOR="Red"]FormDateCheckCIM[/COLOR] Then
Beep
MsgBox "That is the most cows in milk on one day!", vbInformation, "CONGRATULATIONS"
[COLOR="Red"]FormDateCheckCIM[/COLOR].Requery
End If
End Sub