If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem with filling form using query?
Hi,
I have form based on query. I want to choose value in one field on form, and then the other fields on form to fill with appropriate values (one row from table). I made query, I tried it, and it works. But when i choose one value in that field, and then press command button to refresh form, nothing happend - the other fields on form don'r fill?! Why??? Maybe my problem is not in query - it works, probably with my form?! But, how to fix it? Thanks, Smoki |
#2
|
|||
|
|||
Problem with filling form using query?
If you are using a parameter query, it should just ask you what you want and
then query based on that. If not, you need some code. Put a combo box on your form. Allow the wizard to do that for you and allow it to set up what ever you want to search on. Then go into the properties of the combo, go to events, select the afterupdate event, then click on the little button out to the right. Start the code builder and type: Me.filter = "[yourfieldyouwanttolookup] = """ & Me.Combo# & """" Me.filteron = true The combo # will be listed, like combo10 or combo22 -- Milton Purdy ACCESS State of Arkansas "Smoki" wrote: Hi, I have form based on query. I want to choose value in one field on form, and then the other fields on form to fill with appropriate values (one row from table). I made query, I tried it, and it works. But when i choose one value in that field, and then press command button to refresh form, nothing happend - the other fields on form don'r fill?! Why??? Maybe my problem is not in query - it works, probably with my form?! But, how to fix it? Thanks, Smoki |
#3
|
|||
|
|||
Problem with filling form using query?
Dear Milton,
I have done this procedure with combo box, it works. My problem is something else. Actually, I have form with combo box, and when I choose something in combo, i read parameters from one row in db. Then I want to change one parameter. But, this parameter is from another table, and when I change it, I don't change it only in this one row in my primary table, then I change it in those another table, so I change it on all places where it appears Is there any code in VB, how to change it only in one row? Smoki "golfinray" wrote: If you are using a parameter query, it should just ask you what you want and then query based on that. If not, you need some code. Put a combo box on your form. Allow the wizard to do that for you and allow it to set up what ever you want to search on. Then go into the properties of the combo, go to events, select the afterupdate event, then click on the little button out to the right. Start the code builder and type: Me.filter = "[yourfieldyouwanttolookup] = """ & Me.Combo# & """" Me.filteron = true The combo # will be listed, like combo10 or combo22 -- Milton Purdy ACCESS State of Arkansas "Smoki" wrote: Hi, I have form based on query. I want to choose value in one field on form, and then the other fields on form to fill with appropriate values (one row from table). I made query, I tried it, and it works. But when i choose one value in that field, and then press command button to refresh form, nothing happend - the other fields on form don'r fill?! Why??? Maybe my problem is not in query - it works, probably with my form?! But, how to fix it? Thanks, Smoki |
Thread Tools | |
Display Modes | |
|
|