Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2004
    Location
    Washington, DC
    Posts
    14

    Unanswered: editing pulled/pushed data

    Hello all,

    I need some help.....
    Alighty, I have figured out how to pull/push data from a query into a form so it can be viewed. What I have done is when a user selects a subcontractor name from a combo box, it will fill the form in with the information of that subcontractor into yes/no and text boxes by using
    =[select sub].Column (0,1,2....) in the control source. It displays it fine but I cannt edit after i view it and it pops into the form. Is there anyway that I can edit this data? If so, What can I do to be able to edit this data?

    Please Help!!!

    Thank You,
    ~Christina

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    You have to bind these controls with their respective field. Only then you'll be able to edit them.

  3. #3
    Join Date
    Jul 2004
    Location
    Washington, DC
    Posts
    14
    How do you go about binding it to its respective field?

    Thanks,
    Christina

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    control source property for the object.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Jul 2004
    Location
    Washington, DC
    Posts
    14
    So do I need to have it bounded by the column in the combo box and the field in the table like:

    =[select sub].Column(0) & Subcontractors
    Name of column in cb field in table

    Does that look remotely right?

    Thanks,
    Christina

  6. #6
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    Your code seems okay. Go to each individual control (text boxes ) that you are filling through this combo box and goto Data tab in the properties window. The first item would be Control Source. If your form is bound to a query or a table then open the drop down list for the control source will give you a list of all the fields. Pick the appropriate field for that control.

    Try it

  7. #7
    Join Date
    Jul 2004
    Location
    Washington, DC
    Posts
    14
    Thanks.....

    I tried changing the control source to one of the field names and it will allow me to edit the data!! but it will not "pop" the info into the control boxes.

    Do you know of anyway to have the data pop into the control boxes and be able to edit? Does my expression: =[select sub].Column(0) does it need to go somewhere else? I have tried to put both the expression and the field name in the control source box but that is just wrong. Is there another way to have the data "pop" into the control boxes?

    Please help and let me know.

    Thanks,
    CHristina

  8. #8
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    Well..it'll be better if you can post your app and I'll take a look at it. Its getting too confusing now. If not possible then try these steps (if I understand your problem correctly).

    You have a form say frm with a combo box say cmb and bunch of text boxes say txt1 .... so on. Your form frm is bound to a table say tbl.
    Your combo box cmb is bound to field fld0, txt1 to fld1, txt2 to fld2 and so on...

    What you want now is to pick a value from the combobox and the rest of the data is pulled from the table and fill the form. To do this do these steps.

    1.Now bind each of the control to the field of the table (you know how to do that).
    2.In the AfterUpdate event of the combo box use this code.
    Me.RecordsetClone.FindFirst "[fld0]=" & Me.cmb
    Me.Bookmark = Me.RecordsetClone.Bookmark

    This will make that record as the current record.

    Thats it.. Try it

  9. #9
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    And one more thing. The combo box should have the following select statement in the "RowSource" property.

    Select fld0 from tbl

Posting Permissions

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