Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Values Not Passing to Form

Status
Not open for further replies.
Feb 1, 2001
116
US
If I have a table with 4 fields; FieldA, FieldB, FieldC, FieldD.

I have one form with FieldA and FieldB, then a button that opens another form with FieldC and FieldD.

When I push the button for the second form, the data for FieldC and FieldD from the table are not being passed to the form.

I am using the following to open the second form:

Private Sub cmbSuper_Click()
On Error GoTo Err_cmbSuper_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Part2-Super"

stLinkCriteria = "[FieldA]=" & "'" & Me![FieldA] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_cmbSuper_Click:
Exit Sub

Err_cmbSuper_Click:
MsgBox Err.Description
Resume Exit_cmbSuper_Click

End Sub

Any ideas why this isn't working?

Thanks
 
Can you supply a little more detail? I see not mention of FieldC or FieldD, only code to open a form showing a record that matches FieldA on the current form.

Aside: Things are much easier if controls (txtFieldA,cboFieldA etc) and fields (FieldA) do not have the same name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top