Continuous Form OnClick

B

Bob V

I am trying to open the form (frmAdditionalCharges) at the same record/Field
"ChargeNumber" (Text)
I have a Textbox [tbChargeNumber] hidden on my Continuous Form
Thanks for any help ............Bob

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"
stLinkCriteria = "[ChargeNumber]="
DoCmd.OpenForm stDocName, , stLinkCriteria
End Sub
 
R

Rick Brandt

Bob said:
I am trying to open the form (frmAdditionalCharges) at the same
record/Field "ChargeNumber" (Text)
I have a Textbox [tbChargeNumber] hidden on my Continuous Form
Thanks for any help ............Bob

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"
stLinkCriteria = "[ChargeNumber]="
DoCmd.OpenForm stDocName, , stLinkCriteria
End Sub


The line...

stLinkCriteria = "[ChargeNumber]="

....is incorrect. ChargeNumber must be equal to...(some value). Presumably your
hidden control.

stLinkCriteria = "[ChargeNumber]=" & Me.tbChargeNumber
 
B

Bob V

Rick Brandt said:
Bob said:
I am trying to open the form (frmAdditionalCharges) at the same
record/Field "ChargeNumber" (Text)
I have a Textbox [tbChargeNumber] hidden on my Continuous Form
Thanks for any help ............Bob

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"
stLinkCriteria = "[ChargeNumber]="
DoCmd.OpenForm stDocName, , stLinkCriteria
End Sub


The line...

stLinkCriteria = "[ChargeNumber]="

...is incorrect. ChargeNumber must be equal to...(some value).
Presumably your hidden control.

stLinkCriteria = "[ChargeNumber]=" & Me.tbChargeNumber

Thanks Rick but it just keeps opening on the first record in
frmAdditionalCharges
Thanks for helping..Bob

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"
stLinkCriteria = "[ChargeNumber]=" & Me.tbChargeNumber
DoCmd.OpenForm stDocName, , stLinkCriteria
End Sub
 
B

Bob V

SORRY RICK was missing a , argument.....Thanks Bob
Bob V said:
Rick Brandt said:
Bob said:
I am trying to open the form (frmAdditionalCharges) at the same
record/Field "ChargeNumber" (Text)
I have a Textbox [tbChargeNumber] hidden on my Continuous Form
Thanks for any help ............Bob

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"
stLinkCriteria = "[ChargeNumber]="
DoCmd.OpenForm stDocName, , stLinkCriteria
End Sub


The line...

stLinkCriteria = "[ChargeNumber]="

...is incorrect. ChargeNumber must be equal to...(some value).
Presumably your hidden control.

stLinkCriteria = "[ChargeNumber]=" & Me.tbChargeNumber

Thanks Rick but it just keeps opening on the first record in
frmAdditionalCharges
Thanks for helping..Bob

Private Sub tbAdditionCharge_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAdditionalCharges"
stLinkCriteria = "[ChargeNumber]=" & Me.tbChargeNumber
DoCmd.OpenForm stDocName, , stLinkCriteria
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top