Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Australia
    Posts
    183

    Angry Unanswered: How to populate more than one field with DLookUp

    Private Sub cboSuburbID_AfterUpdate()

    cboPostCodeID.value = DLookup("PostCodeID", "luPCodeToSuburb", "SuburbID=" & cboSuburbID.value)

    End Sub

    This is how I populate the postcode once the suburb has been selected, but I would like it to populate the state as well at the same time.

    I can't seem to write it properly nor find anything that might help me.

    Could somebody help me please with this one?

    Regards

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Code:
    Private Sub cboSuburbID_AfterUpdate()
       Me.cboPostCodeID = DLookup("[PostCodeID]", "luPCodeToSuburb", "[SuburbID] = '" & Me.cboSuburbID & "'")
       Me.State = DLookup("[State]", "luPCodeToSuburb", "[SuburbID] = '" & Me.cboSuburbID & "'")
    End Sub


Posting Permissions

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