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

passing record information from one form to another when there's a subform

P: n/a
Let me preface: I'm a novice, and have no programming experience.

I have created an access database and have a few tables in it. I have
created a form called "clients" This form opens up and has alot of
basic client information in it, nothing fancy, no code (other than what
access has put in).

I have created a second form "newVisit" This form has a subform on it
called "client visit subform". The form is just to be used to record
new visit information into a table called "visits". The client info
though is contained in a table called "clients". I have both tables
linked to one another in a one-many relationship via ClientID (primary
key in Clients) which is an autonumber.

Here's my problem: I added a command button to open "newVisit" on the
"clients" form. Which works fine. But I can't get it to open and
populate the fields on the "newVisit" form with the client info from
the "clients" form. I've searched and found some code that does it,
but when I add that code, then the "client visit subform" on the
"newVisit" form ignores the data entry mode that I have set it to. So
I can get the form to open the second form via the command button to
the recordset of the client I am working on, but when I do, the
"newVisit" subform "client visit subform" allows the users to scroll
through visit information for that recordset, which is not what I want
to happen, I want it to be data entry on that subform.

Am I going about the design of the forms wrong? Is there a better way
to pass the record information from one form to another that doesn't
bypass my data entry ONLY needs on that second form?

Any help is appreciated.

Aug 22 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Generally, subforms are for displaying data - that is, if your subform
is in datasheet view - if you have a scrollbar in the subform, then it
is in datasheet view.

Your easiest option would be to create a separate form for data entry.
So you would have one form with a subform for displaying data and a
separate form for data entry.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Aug 22 '06 #2

P: n/a
Rich,

That's kinda what I'm trying to do. I have the main form and I want
the users to click a button on the main form to bring up another form
to enter information into a second table (that is linked via ClientID
field)

My issue is I want the form that gets brought up when the user clicks
the button to be pre-populated with the client information of the
record they were on when they clicked the button. But I don't want
them to be able to change any of that client information or have the
ability to scroll through the "subrecords" or whatever you want to call
them that apply to that data entry form. I've tried alot of methods
but just not sure I'm grasping how to do it correctly.

I tried creating a query that had all of the user information from the
main table and the fields on the second table I want them to input data
into, but I can't get it to autopopulate that form for some reason. I
can do it in code, but when I do that the form comes up as "filtered"
so to speak and it seems to no longer be "data entry" mode.
Rich P wrote:
Generally, subforms are for displaying data - that is, if your subform
is in datasheet view - if you have a scrollbar in the subform, then it
is in datasheet view.

Your easiest option would be to create a separate form for data entry.
So you would have one form with a subform for displaying data and a
separate form for data entry.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Aug 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.