N
Nbene
Hi,
I have gone through this forum and have been going over the same
problem for the past week.
my tables are such
tblContact 1>M tblContactOrganisation M<1 tblOrganisation
i have, from tblcontact, made a form called "frmContactsList" this
form displays the list of contacts (Continuous form)
I have added filtering at the top allowing user to search for
contacts.
In the continuous form there is a Cmd button on each row to open
another form "frmContactDem" with that contacts details from
"tblContact"
frmContactDem.recordsource SQL string SELECT * from tblContact and it
has a subform "frmContactDemSub" which has a record source of
qryContacts (tblContactOrganisation and tblOrganisation)
The form frmContactDem and sub form open perfectly however it only
opens at the one record, obviously the first record.
My issue is that i can not filter the form to display only the contact
that corresponds with the CMD button.
When i click on the CMDbutton i gives me an input box with Garbled
characters but when input an id number into it and press ok it gives
me the right record on the new form.
Private Sub cmdOpen_Click()
Dim SQL, SQL2 As String
Dim IDString As Variant
IDString = ContactId.Value
SQL = "SELECT tblContact.ContactId, tblContact.Title,
tblContact.FirstName, tblContact.MiddleName, tblContact.Surname,
tblContact.TelephoneMobile FROM tblContact "
SQL2 = "WHERE tblContact.ContactId = " & IDString
Form_frmContactDem.RecordSource = SQL + SQL2
DoCmd.OpenForm "frmContactDem", acNormal
End Sub
I hope someone can help me as this is getting frustrating.
Thanks
Nathan
I have gone through this forum and have been going over the same
problem for the past week.
my tables are such
tblContact 1>M tblContactOrganisation M<1 tblOrganisation
i have, from tblcontact, made a form called "frmContactsList" this
form displays the list of contacts (Continuous form)
I have added filtering at the top allowing user to search for
contacts.
In the continuous form there is a Cmd button on each row to open
another form "frmContactDem" with that contacts details from
"tblContact"
frmContactDem.recordsource SQL string SELECT * from tblContact and it
has a subform "frmContactDemSub" which has a record source of
qryContacts (tblContactOrganisation and tblOrganisation)
The form frmContactDem and sub form open perfectly however it only
opens at the one record, obviously the first record.
My issue is that i can not filter the form to display only the contact
that corresponds with the CMD button.
When i click on the CMDbutton i gives me an input box with Garbled
characters but when input an id number into it and press ok it gives
me the right record on the new form.
Private Sub cmdOpen_Click()
Dim SQL, SQL2 As String
Dim IDString As Variant
IDString = ContactId.Value
SQL = "SELECT tblContact.ContactId, tblContact.Title,
tblContact.FirstName, tblContact.MiddleName, tblContact.Surname,
tblContact.TelephoneMobile FROM tblContact "
SQL2 = "WHERE tblContact.ContactId = " & IDString
Form_frmContactDem.RecordSource = SQL + SQL2
DoCmd.OpenForm "frmContactDem", acNormal
End Sub
I hope someone can help me as this is getting frustrating.
Thanks
Nathan