Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup ? (Access 2000)

    We have 2 independend tables customers and clients.from my form Clients i want to open the form
    Customers into a new record, that is CustomerID, and copy the CustomerID into my form Clients.It is difficult for me, since the table clients and
    customers underlying both forms are not interrelated, there is no connection between them.
    In our company we differentiate between a client and a customer.Sometimes we want to convert a client into a customer.To this end we open the form Customers into a new record,called CustomerID and copy all the data from the form Clients into the form Customers.I would like to save the
    CustomerID from the form Customers into the form Clients,but i do not know is it possible at all ?
    I open the form Customers with the following code :


    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "Customers"
    DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
    DoCmd.GoToControl "CompanyName"
    With Forms!FCustomers
    ![CompanyName] = Me![CompanyName]
    !address = Me!address
    !city = Me!city

    End With
    DoCmd.Close acForm, Me.Name


    How can i copy the CustomerID in the form Clients,when the two tables are not connected?
    Maybe i must use the DLookup function,is it possible?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DLookup ? (Access 2000)

    It would be better if you had one table for clients and customers, with a Yes/No field to indicate whether a client is a customer. You would only have to tick a check box to indicate that a client has become a customer. Copying data from one table to another is not efficient, and keeping separate copies of the same data violates relational design.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •