Potentially simple update question (1 Viewer)

twoplustwo

Registered User.
Local time
Today, 09:42
Joined
Oct 31, 2007
Messages
507
Hi all,

I have a form that is filtered BeforeUpdate by selecting a company on the primary form then passing the CompanyID to the form that opens.

This displays the selected company details along with a subform for clients against said company.

I am able to edit details for each customer but not the parent company. The form looks for OpenArgs in the BeforeUpdate event with the below code behind a button after selecting a company.

Code:
Private Sub cmdEdit_Click() 'Pull customer name for use in filter
    
    Dim strCustomerID As String
    
    If Not IsNull(Me.lstCompanies.Column(1)) Then
        strCustomerID = Me.lstCompanies.Column(1)
                  
    DoCmd.OpenForm "frmCustomerSiteUpdate", acNormal, , "CustomerID=" & strCustomerID, , acWindowNormal, strCustomerID
    
    End If
    
End Sub

I have allowed data edits in the second form fwiw.

Thanks a lot.
 

ErikSnoek

Programmer
Local time
Today, 09:42
Joined
Apr 26, 2007
Messages
100
It's a bit hard to determine the problem after reading your description. Could you post the relevant part of the database so we can all take a look? Of course you do not have to include the real data ;)
 

neileg

AWF VIP
Local time
Today, 17:42
Joined
Dec 4, 2002
Messages
5,975
Do you mean you want to be able to change the parent company for the customer? I would do this by basing the customer for on a parameter query instead of filtering the form.
 

twoplustwo

Registered User.
Local time
Today, 09:42
Joined
Oct 31, 2007
Messages
507
Hi Neil,

Not really the parent company - just have the ability to change details such as address etc. should the user require to do so.
 

neileg

AWF VIP
Local time
Today, 17:42
Joined
Dec 4, 2002
Messages
5,975
I don't understand. Where are you trying to edit the company details?
 

Users who are viewing this thread

Top Bottom