Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Aug 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating form fields from foreign source (2003)

    <!t>[pre]<!/t> and <!t>[/pre]<!/t> tags added by HansV to preserve spacing - see <!help=19>Help 19<!/help>

    I have a form to add records to a tblInvoice.
    <pre>tblInvoice qryNotInInvoice
    ========== ===============
    Laid (PK) Laid (PK)
    Worker* Worker*
    Panel* Panel*
    ResDt
    InvoiceNo
    etc
    </pre>

    If I have a combo box to select a LAID from qryNotInInvoice, how does one LAID_AFTERUPDATE event automatically copy the Worker and Panel details from qryNotInInvoice into the respective form fields for tblInvoice?

    Cheers!

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

    Re: Updating form fields from foreign source (2003)

    You can set the Column Count for the combo box to 3, and if you like, the Column Widths property to 1",0", 0". In the After Update event of the combo box, you can set Worker and Panel to the 2nd and 3rd column of the combo box. Columns are indexed starting at 0, so the first column has index 0, the second has index 1, etc.

    If IsNull(Me.Laid) Then
    ' Combo box cleared
    Me.Worker = Null
    Me.Panel = Null
    Else
    ' Copy data from columns in combo box
    Me.Worker = Me.Laid.Column(1)
    Me.Panel = Me.Laid.Column(2)
    End If

  3. #3
    New Lounger
    Join Date
    Aug 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating form fields from foreign source (2003)

    Cheers Hans.

    Your suggestion worked a treat however one of the fields however that I didn't mention was a date field. I then tried format() and datevalue() but with no success. Instead I get a Runtime Error 438 "Object doesn't support this property or method". Any suggestions?


    Thanking you.

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

    Re: Updating form fields from foreign source (2003)

    Where and how did you try to use Format and DateValue?

Posting Permissions

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