Makaveli
07-14-2008, 06:13 AM
My first post,
I have one form called propertys and another called vendor.
In the form propertys i have a button that opens up the other form called vendor, and like a subform (which i cant use in this case because of the massive amount of data) I have restricted the form vendor to the data being displayed in propertys by using the code at the bottom of this post. (which im no good at)
With this code the vendor form in data entry links the data via the property id field which is a auto/key number to the propertys table.
So when i add new data in the valuation form access relates it back to the property,
however when i have this form in a mode where i can also browse through the data it doesnt just limit it to the property id selected in the property form but it goes through all the data ever entered in the valuation form regardless of propperty id.
Can anyone please help me come up with a soloution where the valuation form is limited via the property selected. Thanks Makaveli
Propertys code:-
Private Sub Vendor_Click()
On Error GoTo Err_Vendor_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "02 Create Vendor"
DoCmd.OpenForm "02 Create Vendor", acNormal, , [Property ID] = " & me.[property id]"
Exit_Vendor_Click:
Exit Sub
Err_Vendor_Click:
MsgBox Err.Description
Resume Exit_Vendor_Click
Vendors code:-
Private Sub Form_beforeUpdate(Cancel As Integer)
Me.[Property ID] = Forms![add-edit-search property]![Property ID]
End Sub
I have one form called propertys and another called vendor.
In the form propertys i have a button that opens up the other form called vendor, and like a subform (which i cant use in this case because of the massive amount of data) I have restricted the form vendor to the data being displayed in propertys by using the code at the bottom of this post. (which im no good at)
With this code the vendor form in data entry links the data via the property id field which is a auto/key number to the propertys table.
So when i add new data in the valuation form access relates it back to the property,
however when i have this form in a mode where i can also browse through the data it doesnt just limit it to the property id selected in the property form but it goes through all the data ever entered in the valuation form regardless of propperty id.
Can anyone please help me come up with a soloution where the valuation form is limited via the property selected. Thanks Makaveli
Propertys code:-
Private Sub Vendor_Click()
On Error GoTo Err_Vendor_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "02 Create Vendor"
DoCmd.OpenForm "02 Create Vendor", acNormal, , [Property ID] = " & me.[property id]"
Exit_Vendor_Click:
Exit Sub
Err_Vendor_Click:
MsgBox Err.Description
Resume Exit_Vendor_Click
Vendors code:-
Private Sub Form_beforeUpdate(Cancel As Integer)
Me.[Property ID] = Forms![add-edit-search property]![Property ID]
End Sub