Subfrm Control

brsawvel

Registered User.
Local time
Today, 12:24
Joined
Sep 19, 2007
Messages
256
Hello,

I attached a db to better display what I'm attempting to do. How can I get fld1 in subfrm1 (which is in column view) to display the same data in subfrm2 (which is in tabular view)? --

so if I click on the text displaying "dog" in subfrm1, subfrm2 displays "dog" row. If I click on "cat", subfrm2 displays "cat" row?
 

Attachments

If you are trying to use this as a search or reference why not use a listbox ?
 

Attachments

I like what you came up with OldSoftBoss, but now my next question is, is there a way, when you select a record from the list box (when it is a subform within a form) that it would open the data in a second subform?

frm1 - contains subfrm1 & subfrm2
subfrm1 - listbox
subfrm2 - detailed box
 
Why you would ever want to do that I am not sure, but anyway.....
 

Attachments

I tried setting up a mirrored "After Update" but got the following Error (91) on my database - Object variable or With block variable not set. I used this code:

Private Sub List55_AfterUpdate()
Dim rs As Object

Set rs - Forms!frmAM!subfrmDetail.Form.Recordset.Clone
rs.FindFirst "[AssetID] = '" & Me![List55] & "'"
Forms!frmAM!subfrmDetail.Form.Bookmark = rs.Bookmark

End Sub


I also tried changing the code, thinking I was supposed to put the name of the form where you have "Form". When I did that, I got this Error (438) - Object doesn't support this property or method. For that one, I used this code:

Private Sub List55_AfterUpdate()
Dim rs As Object

Set rs - Forms!frmAM!subfrmDetail.frmAM.Recordset.Clone
rs.FindFirst "[AssetID] = '" & Me![List55] & "'"
Forms!frmAM!subfrmDetail.FrmAM.Bookmark = rs.Bookmark

End Sub
 
I figured it out. I have to have the subform visible first before I can click on one of the fields in the listbox.
 
Hello Old Soft Boss,

I'm trying to replicate the above code for another database I'm creating for my company. But I'm getting an error with this one. Can you see anything that I'm doing wrong?
 

Attachments

If the error is 3464, mis match then the error is in the rs find line

rs.FindFirst "[fldAuto] = '" & Me![List0] & "'" is searching for a text field.
Try
rs.FindFirst "[fldAuto] = " & Me![List0]
This is for a numeric field.

Dave
 
You're most likely right on this one. Since fldAuto is a numeric field. I'll try it when I get to work. Thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom