Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Update a form, based on a selection from another form

Posted on 2011-09-09
7
Medium Priority
?
281 Views
Last Modified: 2012-05-12
I have setup two networked PCs with MSAccess 2003.
I want the first pc to put entries into a table using a form, then what ever entry is currently selected on the 1st PC's form called form1, I want the 2nd pc to display that record on the 2nd PCs form2.
to amplify.
I have a table with only 4 entries.
On form 1 on pc 1 i have selected entry 3.
I want pc 2 using form2 to display the entry 3.
Then if i change the entry on PC1 form1 to entry 2
I want pc 2 to reflect entry 2
Can u advise?
0
Comment
Question by:jwjjwj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36514856
I hope you are good at VBA...
Note that while this works, things like this (running commands across databases) is *extremely* risky and unpredictable.
You will also have to customize this code to work just the way you need it to.

But again, it works OK in both PC are *Tightly controlled*, otherwise all sorts of odd things can start happening...
(You should have iron-clad error handling on all subs and perhaps implement "RollBack" code)
This is why I stated that you should be well versed in VBA before attempting this...


In any event...
Put this in the code for the Form in the 1st PC:

Private acc As Access.Application

Private Sub Form_Open(Cancel As Integer)
Set acc = New Access.Application
    acc.OpenCurrentDatabase "c:\YourFolder\TargetDB.mdb"
    acc.Visible = True
    acc.DoCmd.OpenForm "frmCustomers"
End Sub

Private Sub Form_Current()
Dim strCustID As String
strCustID = Me.CustomerID
    acc.DoCmd.OpenForm "frmCustomers", , , "CustomerID=" & "'" & Me.CustomerID & "'"
End Sub


Private Sub Form_Close()
    acc.CloseCurrentDatabase
    Set acc = Nothing
End Sub



Make sure the second db has the exact same form name and table available.

;-)

JeffCoachman
0
 

Author Comment

by:jwjjwj
ID: 36516035
Hi Jeff, thanks for that, however I have not explained myself clearly enough.
There is only one db, with one table and two forms. one and entry form on the 1st pc and the other a display form on a 2nd pc, both from the same db.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36516468
Is the one DB "Split"?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:jwjjwj
ID: 36517876
No, the db is not split. it is just a stock standard database, networked between two pc's.
One pc has and update form, the other a display of the latest data which has been seletect on the update form
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 36526635
Try this

(It is not clear how you are handling the opening and closing of these forms, but this should work...)

Have two forms with the same recordsource.
On Form1 (The"Control" form) put code like this on the current event:

Forms![Form2].Filter = "ID=" & me.ID
Forms![Form2].FilterOn = True

I am sure you can easily modify this to work in your database.
0
 

Author Closing Comment

by:jwjjwj
ID: 36527402
Thank u - works like a dream.
May require further help as I now have to kick off a list that I want to display, but if so, I will ask another question.
Regards
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36529623
;-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question