![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a Form called 'frmPolicy' upon which are two text boxes called respectively 'txtPolicyNo' (datatype nvarchar) and 'txtPolicyVer' (datatype integer). I need to use these criteria to open a new form called 'frmOtherCountryTax' with a command button; I need to both Edit and Add information once the form is open. The form's data source is a table named 'OtherCountryTax' with fields named 'policy_no' and 'version_no'. I have used the wizard, trawled help blogs and bulletin boards for hours and tried loads of different 'solutions' all of which bring up error messages, cancel the operation or won't allow me to edit or add the data. The latest version is: Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmOtherCountryTax" stLinkCriteria = "[policy_no]= " & Val(Me![txtPolicyNo]) & " And [version_no]= " & Me![txtPolicyVer] stLinkCriteria = "[policy_no]=" & Me![txtPolicyNo] & " AND [version_no]= " & Me![txtPolicyVer] DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal Can anyone help before I go completely mad? |
#3
| |||
| |||
|
|
Try: * *stLinkCriteria = "[policy_no]= '" & Me![txtPolicyNo] & "'AND [version_no]= " & Me![txtPolicyVer] (as txtPolicyNo is text you have to enclose the value in additional literals) DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal You haven't used strLinkCriteria in the DoCmd but I presume that is a typo, plus if you don't specify data mode then make sure that the AllowEdits and AllowAdditions properties of frmOtherCountryTax are set to Yes. HTH Jon "FireyColin" <colin.mard... (AT) btopenworld (DOT) com> wrote in message news:3f366c1a-d9c2-4cb7-a5eb-79b8126fc2e0 (AT) o14g2000yqh (DOT) googlegroups.com... I have a Form called 'frmPolicy' upon which are two text boxes called respectively 'txtPolicyNo' (datatype nvarchar) and 'txtPolicyVer' (datatype integer). *I need to use these criteria to open a new form called 'frmOtherCountryTax' with a command button; I need to both Edit and Add information once the form is open. *The form's data source is a table named 'OtherCountryTax' with fields named 'policy_no' and 'version_no'. *I have used the wizard, trawled help blogs and bulletin boards for hours and tried loads of different 'solutions' all of which bring up error messages, cancel the operation or won't allow me to edit or add the data. The latest version is: * *Dim stDocName As String * *Dim stLinkCriteria As String * *stDocName = "frmOtherCountryTax" * *stLinkCriteria = "[policy_no]= " & Val(Me![txtPolicyNo]) & "And [version_no]= " & Me![txtPolicyVer] * *stLinkCriteria = "[policy_no]=" & Me![txtPolicyNo] & " AND [version_no]= " & Me![txtPolicyVer] * *DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal Can anyone help before I go completely mad?- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
Try: stLinkCriteria = "[policy_no]= '" & Me![txtPolicyNo] & "' AND [version_no]= " & Me![txtPolicyVer] (as txtPolicyNo is text you have to enclose the value in additional literals) DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal You haven't used strLinkCriteria in the DoCmd but I presume that is a typo, plus if you don't specify data mode then make sure that the AllowEdits and AllowAdditions properties of frmOtherCountryTax are set to Yes. HTH Jon "FireyColin" <colin.mard... (AT) btopenworld (DOT) com> wrote in message news:3f366c1a-d9c2-4cb7-a5eb-79b8126fc2e0 (AT) o14g2000yqh (DOT) googlegroups.com... I have a Form called 'frmPolicy' upon which are two text boxes called respectively 'txtPolicyNo' (datatype nvarchar) and 'txtPolicyVer' (datatype integer). I need to use these criteria to open a new form called 'frmOtherCountryTax' with a command button; I need to both Edit and Add information once the form is open. The form's data source is a table named 'OtherCountryTax' with fields named 'policy_no' and 'version_no'. I have used the wizard, trawled help blogs and bulletin boards for hours and tried loads of different 'solutions' all of which bring up error messages, cancel the operation or won't allow me to edit or add the data. The latest version is: Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmOtherCountryTax" stLinkCriteria = "[policy_no]= " & Val(Me![txtPolicyNo]) & " And [version_no]= " & Me![txtPolicyVer] stLinkCriteria = "[policy_no]=" & Me![txtPolicyNo] & " AND [version_no]= " & Me![txtPolicyVer] DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal Can anyone help before I go completely mad?- Hide quoted text - - Show quoted text - |
#5
| |||
| |||
|
|
I have a Form called 'frmPolicy' upon which are two text boxes called respectively 'txtPolicyNo' (datatype nvarchar) and 'txtPolicyVer' (datatype integer). *I need to use these criteria to open a new form called 'frmOtherCountryTax' with a command button; I need to both Edit and Add information once the form is open. *The form's data source is a table named 'OtherCountryTax' with fields named 'policy_no' and 'version_no'. *I have used the wizard, trawled help blogs and bulletin boards for hours and tried loads of different 'solutions' all of which bring up error messages, cancel the operation or won't allow me to edit or add the data. The latest version is: * * Dim stDocName As String * * Dim stLinkCriteria As String * * stDocName = "frmOtherCountryTax" * * stLinkCriteria = "[policy_no]= " & Val(Me![txtPolicyNo]) & " And [version_no]= " & Me![txtPolicyVer] * * stLinkCriteria = "[policy_no]=" & Me![txtPolicyNo] & " AND [version_no]= " & Me![txtPolicyVer] * * DoCmd.OpenForm stDocName, acNormal, , , , acWindowNormal Can anyone help before I go completely mad? |
![]() |
| Thread Tools | |
| Display Modes | |
| |