Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    exporting data (2000)

    Hello, I have a situation where I look up clients in in one form, I would like to on click of a button on the client form to take the client ID and auto place that in a client ID field on a booking form. What sort of code should I be using?

    Thanks Darren.

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

    Re: exporting data (2000)

    1) Is the booking form already open, or should the code open it?
    2) Is the booking form bound to a table?
    2a) If so, should the code create a new record in the booking form, or use the currently active record?

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: exporting data (2000)

    Thanks Hans, booking form is bound and not currently open. Code could open booking form and create new record.

    Thanks darren.

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

    Re: exporting data (2000)

    Say that the command button is named cmdBooking, the client ID control is named ClientID and the form is named frmBookings. The code could look like this:

    Private Sub cmdBooking_Click()
    If IsNull(Me!ClientID) Then
    MsgBox "No client ID", vbInformation
    Exit Sub
    End If

    DoCmd.OpenForm FormName:="frmBookings", DataMode:=acFormAdd
    Forms!frmBookings!ClientID = Me!ClientID
    End Sub

  5. #5
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: exporting data (2000)

    Thanks Hans

    spot on

Posting Permissions

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