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?
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.
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?
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