Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Angry Unanswered: Updateble Unbound form field

    I have a field(location) on a form that need to get data from a drop-down table list(locations). Is this a problem if the field is unbound?????????

  2. #2
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67

    Re: Updateble Unbound form field

    Originally posted by garrydawkins
    I have a field(location) on a form that need to get data from a drop-down table list(locations). Is this a problem if the field is unbound?????????
    No, are you having a problem?

    Unbound fields are often used for setting criteria in filtering a recordset on event change.

  3. #3
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Unhappy Re: Updateble Unbound form field

    Yes, I'm having problems, it is a sub-form and part of the form is based on a query. Will this have any affect?

    Originally posted by Robt917
    No, are you having a problem?

    Unbound fields are often used for setting criteria in filtering a recordset on event change.

  4. #4
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67

    Re: Updateble Unbound form field

    Originally posted by garrydawkins
    Yes, I'm having problems, it is a sub-form and part of the form is based on a query. Will this have any affect?
    I am assuming that you have created an unbound ComboBox with your options showing in the list okay?

    Where the object is place is not significant, although you will find it easier to code if you place it on the form where the data is being used.

    If it is an unbound field you are attempting to use the data so either on AFTERUPDATE or Command Button click you are writing some code to use this option.

    Is the problem getting the option data into the query?

    Can you write in you code the statement

    Msgbox forms!MyForm!MyOption

    and have it showup?

  5. #5
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Unhappy Unbound fields

    You have a excellent handle on this. I'll attach a copy of the form. Please take a look.

  6. #6
    Join Date
    Apr 2003
    Location
    Washington DC area
    Posts
    1,770

    Re: Unbound fields

    Private Sub cboPartLocation_AfterUpdate()

    val1 = rs.getValue(1)
    Update tblpartinstance
    Set datereceived = txtDatReceived And PartLocation = cboPartLocation
    where partinstnceid = var1


    If cboPartLocation = constONORDER Or cboPartLocation = constCANCELLED Then
    txtPartDateReceived = Null
    End If
    End Sub

    Originally posted by garrydawkins
    You have a excellent handle on this. I'll attach a copy of the form. Please take a look.

  7. #7
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67

    Re: Unbound fields

    Originally posted by garrydawkins
    Private Sub cboPartLocation_AfterUpdate()

    val1 = rs.getValue(1)
    Update tblpartinstance
    Set datereceived = txtDatReceived And PartLocation = cboPartLocation
    where partinstnceid = var1


    If cboPartLocation = constONORDER Or cboPartLocation = constCANCELLED Then
    txtPartDateReceived = Null
    End If
    End Sub
    I'm going to assume that
    val1
    generate a value? It is not defined here.

    Try this:

    sql$ = "Update tblpartinstance Set datereceived = txtDatReceived And PartLocation = " & Forms!MyForm!MySubForm.Form!cboPartLocation & " where partinstnceid = var1"

    DoCmd.runsql sql$

Posting Permissions

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