By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

CreateForm help

P: n/a
I want to create a form dynamically using the createform method. The
form's record source is a query. I want to make the form continuous and
in tabular format...... and I also want to automatically put the fields
from the record source in the form.... If one were to do this using the
form wizard, this what I want to accomplish.

Thanks

Oct 26 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

jjp3...@wowway.com wrote:
I want to create a form dynamically using the createform method. The
form's record source is a query. I want to make the form continuous and
in tabular format...... and I also want to automatically put the fields
from the record source in the form.... If one were to do this using the
form wizard, this what I want to accomplish.

Thanks
Try this.

Private Sub Form_Template_Click()

Dim frm As Form

'Create a new form based on the XXXXX form
Set frm = CreateForm(, "existing_form")
DoCmd.Restore

'Set RecordSource property to inputQuery query
frm.RecordSource = "YourInputQuery"

End Sub

Oct 26 '06 #2

P: n/a

Tanis wrote:
jjp3...@wowway.com wrote:
I want to create a form dynamically using the createform method. The
form's record source is a query. I want to make the form continuous and
in tabular format...... and I also want to automatically put the fields
from the record source in the form.... If one were to do this using the
form wizard, this what I want to accomplish.

Thanks

Try this.

Private Sub Form_Template_Click()

Dim frm As Form

'Create a new form based on the XXXXX form
Set frm = CreateForm(, "existing_form")
DoCmd.Restore

'Set RecordSource property to inputQuery query
frm.RecordSource = "YourInputQuery"

End Sub
Oct 26 '06 #3

P: n/a

Tanis wrote:
jjp3...@wowway.com wrote:
I want to create a form dynamically using the createform method. The
form's record source is a query. I want to make the form continuous and
in tabular format...... and I also want to automatically put the fields
from the record source in the form.... If one were to do this using the
form wizard, this what I want to accomplish.

Thanks

Try this.

Private Sub Form_Template_Click()

Dim frm As Form

'Create a new form based on the XXXXX form
Set frm = CreateForm(, "existing_form")
DoCmd.Restore

'Set RecordSource property to inputQuery query
frm.RecordSource = "YourInputQuery"

End Sub


I tried this but in the end when the above code is run, I get a blank
form with the field list box showing, which I'm assuming it's asking me
to drag the field onto the form. Any idea of how I can 'drag' the field
onto the form automatically ?

Thanks

Oct 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.