Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Same record for multiple forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
spcruise - 02 May 2007 16:30 GMT
I am using Access 2003.  I am familiar with the very basics of VBA but I
think my problem can be solved with some help regarding vba and syntax.

We refurbish & recover rollers from paper producing machines at our
facility.  I am working on a database that will centralize al the data that
is generated when the roll comes in for service.  Currently each dept keeps a
record of just what they do.  Below is sample production route that I have
simplified:

1. The Roll is recieved and given a unique sales order number.
2. Roll goes through an inspection process.
3. Roll receives a new cover.
4. The new cover is ground to customer specs.
5. Roll is balanced.
6. Roll is shipped to customer.

I have created a main form (roll_data) that is the main screen for
monitoring a roll through the plant.  The customer service rep creates a new
record when received in the roll_data form with basic info for the roll along
with the customer info and assigns a sales order number.  The roll_data pulls
certain info from the forms listed below for ease of viewing instead of
pulling up every form.

Additional forms include the inspection_form, cover_form, grinding_form,
balance_form and shipping_form.  Each form has it's own table using the sales
order number as the primary key.  Each department populates the appropriate
field with data for the roll. Example: The Grinding dept will populate the
grinding_form and so on.  I had to split each process into it's own
form/table due to field limitations in access.

The problem:  If I have a roll for sales order 402818 displayed on the main
form (roll_data) and click one of the links I have to another form
(inspection, cover, grinding, balance, shipping), I want it to pull up the
appropriate form for sales order 402818.  Instead, it pulls up the first
record in that table.

I have researched it here and it sounds like I will need to apply some sort
of filter or where staement to the button to carry the sales order (primary
key for each table) forward.  I have even played with the OpenArgs statement
with no success.

Please understand that I am an IT person by trade but have not had alot of
experience with actual coding.  It has been difficult for me to get out of my
Excel mindset.

Thanks for any and all help!
Damon Heron - 02 May 2007 23:42 GMT
Openargs should work.  What was the problem you were having?
Here is how to do it:

The command button that calls up the form you want:

-enter in the click event-
dim selected as variant    'using variant here because I don't know your
datatype - it could be long?
selected= me.[yoursalesorderfield]
docmd.openform "your formname",acnormal,,,,acdialog, selected

then on the load event of the form you are opening,
me.[yoursalesorderfieldon the new form]= me.openargs

hth
Damon

>I am using Access 2003.  I am familiar with the very basics of VBA but I
> think my problem can be solved with some help regarding vba and syntax.
[quoted text clipped - 54 lines]
>
> Thanks for any and all help!
spcruise - 03 May 2007 19:52 GMT
I tried the code you suggested with my field names to no avail.  If it helps,
my sales order field is a text field in each table.  Does the line for the on
load event stand alone?  Like I said before, I am technical in nature but
jsut getting my feet wet with writing/understanding code.

Thanks again for any help!

> Openargs should work.  What was the problem you were having?
> Here is how to do it:
[quoted text clipped - 71 lines]
> >
> > Thanks for any and all help!
Damon Heron - 04 May 2007 16:32 GMT
When you say it didn't work, what exactly happened?  Are you familiar with
breakpoints?  Did you compile the code (in the VB Window)?  Set a breakpoint
at the beginning of the command button click event and follow it thru.  Let
me know where it fails.

Damon

>I tried the code you suggested with my field names to no avail.  If it
>helps,
[quoted text clipped - 88 lines]
>> >
>> > Thanks for any and all help!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.