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

How can I add values to a datasheet subform with a command button on the parent form?

P: 34
I have a button on a parent form. OnClick, I would like the subform datasheet to fill in a set of 11 records into one column (ValveID) with specific values. Consider it a sample set that is specific to each record of the parent form.
Record 1... ValveID = "Valve A"
Record 2... ValveID = "Valve B"
Record 3... ValveID = "Valve C"
Jan 28 '19 #1
Share this Question
Share on Google+
1 Reply

P: 34

Create a query that gives you the information you want to transfer.
Change the select query to an append query.
Create a button on your form and write the following On Click event:

Private Sub ButtonName_Click()
CurrentDb.Execute "QueryName", dbFailOnError
MsgBox ("You did it!")
End Sub
Jan 31 '19 #2

Post your reply

Sign in to post your reply or Sign up for a free account.