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

subform to add records

P: 12

I am a novice db developer with a two part question & I am hoping for some expert help.

1) I have a bound form with a sub form to capture medications taken by a client. For each each client the number of medications can vary. I have coded a prompt (input box) to determine how many meds the client takes and them populate the subform with that many text boxes to enable detail data entry for each of the meds. I believe I have to open a recordset and have it bound to the sub form. Is this logic correct? Is there a better way to accomplish this? What would the code look like?

2) When looking at a specific client how do I display all of /only the meds for that client (on the sub form). I could simply have multiple empty text boxes on the sub form but I think there is a means to accomplish this with code so that I can accomodate the variation and avoid the form clutter. If so, how would I do this?

I really appreciate any insight or suggestions.

May 27 '09 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 2,653
Hello, John.

Looks like this stuff could help you.

May 27 '09 #2

Expert Mod 15k+
P: 31,712
  1. I wouldn't even ask the operator to determine the number of items in advance. A subform could handle adding the items required on the fly.
  2. How the subform is linked (LinkMasterFields & LinkChildFields properties) mainly determines this I believe. If the main form's recordset is filtered to show just the current record, then the subform should follow suit. If you want the main form to contain various records, but have the subform reflect only those associated with the current record, then you would set the Filter properties of the subform in the OnCurrent event procedure of the main form.
May 27 '09 #3

Post your reply

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