Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    74

    Unanswered: differentiate similar fields

    hi,

    i have a search function where i want it to goes accordingly to what i have choose from the combo box. however it base on the my primary key to search, how can i avoid this??


    i have attached a db for better understanding.
    pls advice,
    nono
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: differentiate similar fields

    Originally posted by damnnono_86
    hi,

    i have a search function where i want it to goes accordingly to what i have choose from the combo box. however it base on the my primary key to search, how can i avoid this??


    i have attached a db for better understanding.
    pls advice,
    nono
    I'll keep it simple.

    If you switch your columns around and put the account number in first it will display as you wish. You will need to set the columns in the two textbox controlsources differently also. There is probably more to what you want to do but for display in the textboxes on the form, this works.

    Gregg

  3. #3
    Join Date
    Nov 2003
    Posts
    74

    differentiate similar fields

    hi,

    if i switch the accountno to the combo box and change my sql statement. it will gives me error.

    this is what i wrote for my sql:

    Me.RecordSource = "SELECT Customer_Account_Table.[Branch Name],
    FROM Customer_Table INNER JOIN Customer_Account_Table ON Customer_Table.NRIC = Customer_Account_Table.NRIC WHERE (((Customer_Account_Table.[Account No])=[Forms]![formName]![cboSelectGroup]));"

    can u guide me what is wrong with this code.

    pls advice
    nono

  4. #4
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: differentiate similar fields

    Originally posted by damnnono_86
    hi,

    if i switch the accountno to the combo box and change my sql statement. it will gives me error.

    this is what i wrote for my sql:

    Me.RecordSource = "SELECT Customer_Account_Table.[Branch Name],
    FROM Customer_Table INNER JOIN Customer_Account_Table ON Customer_Table.NRIC = Customer_Account_Table.NRIC WHERE (((Customer_Account_Table.[Account No])=[Forms]![formName]![cboSelectGroup]));"

    can u guide me what is wrong with this code.

    pls advice
    nono
    I wasn't changing the Recordsource for the form, I just changed the RowSource for cboSelectGroup. If you reorder that then the text boxes will display what you want.

    SELECT Customer_Account_Table.[Account No], Customer_Table.Name, Customer_Table.NRIC
    FROM Customer_Table INNER JOIN Customer_Account_Table ON Customer_Table.NRIC = Customer_Account_Table.NRIC
    ORDER BY Customer_Table.Name;


    Gregg

  5. #5
    Join Date
    Nov 2003
    Posts
    74

    differentiate similar fields

    yuppie!!

    It is done. thanks for your help

    pls advice
    nono

Posting Permissions

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