A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem with filling form using query?



 
 
Thread Tools Display Modes
  #1  
Old November 6th, 2009, 08:28 AM posted to microsoft.public.access.forms
Smoki
external usenet poster
 
Posts: 54
Default 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  
Old November 6th, 2009, 02:28 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default 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  
Old January 25th, 2010, 12:57 PM posted to microsoft.public.access.forms
Smoki
external usenet poster
 
Posts: 54
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.