mdikbal99,
Welcome to Bytes!
I think I understand what you are trying to do, but your terminology prevents me from being certain about it.
First, a query cannot be made as a form. A query simply extracts data from a database. A form displays that information in a user interface. But, I think I understand what you mean.
Second, in order for you to have a subform on a form, the best way to do that is to create that subform, and place it on your main form. Then you can assign a query as a record source for that subform. However, you much make sure that when you create the subform that all the appropriate controls havecontrol sources that match up with the results of your query. In your case, you need a subform that has a control for "ID".
To assign a query as a record source:
- Private Sub cmdAssignQuery_Click()
-
Dim strSQL As String
-
-
strSQL = "SELECT ID FROM Table1;"
-
With Me.fsubYourSubForm
-
.RecordSource = strSQL
-
.Requery
-
End With
-
-
end Sub
However, I would guess that you have more going on that what is on the surface.
Without greater detail, we cannot assist much beyond this.
Hope this hepps!