Hi,
I have a edit section in my database that has a listbox that displays records by clicking on a button. I use the following code to excecute the command:
DoCmd.OpenForm "Formname", , , _
"[tblname].[fieldname]=" & "'" & Me.typelistnamehere.Column(0) & "'"
'Close the dialog box
DoCmd.Close acForm, "Edit Form"
THis is a form that has a subform.
Ok, So the above code only works when i REFER to a fieldname that is a text datatype like "Titlename".I dont why it works that way but it does. Now, this particular main form only has two fields:Both which are number fields "CommitmentID" and "BorrowerID(FK)". The subform has textfields like FacilityName.
The problem is that i always cant refer to the subform field to OPEN the MAIN FORM. Whenever i do the following code:
Code:
DoCmd.OpenForm "AddCommitmentDetail", , , _
"[tblFacilitySub].[FacilityName]=" & "'" & Me.ListShowCommit.Column(2) & "'"
'Close the dialog box
DoCmd.Close acForm, "SelectEditCommitment"
Access just asks me for the parameter value of facilityname. I think this is because the mainform table is actually tblCommitment and i cant refer to another table that is called tblFacilitySub.This table is the control source of my subform. So any ideas how to solve this? I have done this previously with success but only using text fields....