Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    79

    Unanswered: Loading primary key

    I'm apologizing in advance if this is way easy. I'm BRAND NEW to Access and VB code. I'm writing an invoice program and need to identify the BillToNumber. I have 2 combo boxes, one for shipper number and one for consignee number. I have an option group where user can select which (shipper or consignee) is the BillToNumber. Because the user is not actually entering the BillToNumber, I don't know where to add code to assign
    Here's what I was trying???

    Dim BTN As Single
    If BillTo = 1 Then
    BTN = Shipper.Value
    Else
    BTN = Consignee.Value
    EndIf
    Forms!frmInvoice!BillToNumber = BTN

    BillToNumber is name of control and name of field in table. I don't even need it as a control, I just need the table updated.

  2. #2
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    100

    Re: Loading primary key

    Ok, you can do a SQL.
    "UPDATE Table SET BillToNumber = " & BTN & "WHERE PK=" & .....

    You can use DoCmd to execute the query.

Posting Permissions

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