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  

COULD SOMONE PLEASE HELP?



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2005, 08:27 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default COULD SOMONE PLEASE HELP?

I need some help figuring something out. I'm not sure if I heading in
the correct direction. What I'm trying to accomplish is the following.
I have a table that has id, discrip, and 2 date fields. I am populating
this information
from a sub from on a main form. The Id and date fields are tied
together in the forms. I am
trying to get the descrip field to show up in my main form under a
listbox. I have
created a sql query to try to accomplish this. I can have multiple
lines of information for each id. That's why I'm trying to show in
list box. The problem I am having is I cannot get it to look for
specific id of the current page I'm on in the form. It prompts me for
id. If I enter the id the list box displays correct info. I would like
for it to see what page I'm on in my form take the id from there and
fill the list box accordingly. When I change sheets it would
automatically update. I have pasted sql query below. I would really
appreciate any insight on how to make this work. Thanks ahead of time.



Perhaps Im not making myself clear. I want a list box to show
information from a table in a form. The table is not the table that
main form is driving. I want the list box to see the reservationid from

the form on which ever record is active, and to show only the
information where the 2 reservation id's are =. The list box will work
if I type in reservationid, but it won't get it from the active form
page like I want. Hopefully this bettrer explains problem.


SELECT [reserve].[site], [reserve].[reservationid],
[reservations].[reservationsid]
FROM reserve
WHERE (([reserve].[reservationid])=([reservations].[reservationsid]));

  #2  
Old December 7th, 2005, 11:36 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default COULD SOMONE PLEASE HELP?

On 7 Dec 2005 12:27:51 -0800, "deercreek" wrote:

Please don't shout at us. We're all volunteers, and the only reason we
COME here is to help. You'll get much better response if you put a
brief indication of the nature of the problem in the subject line.

I need some help figuring something out. I'm not sure if I heading in
the correct direction. What I'm trying to accomplish is the following.
I have a table that has id, discrip, and 2 date fields. I am populating
this information
from a sub from on a main form. The Id and date fields are tied
together in the forms.


What are the Recordsources of the two Forms? Both the same table??

I am trying to get the descrip field to show up in my main form under a
listbox. I have
created a sql query to try to accomplish this. I can have multiple
lines of information for each id.


That would typically be done with a continuous Subform, not a listbox;
if you want to be able to edit the Descrip a subform would be
essential, since you cannot edit data in a listbox.

That's why I'm trying to show in
list box. The problem I am having is I cannot get it to look for
specific id of the current page I'm on in the form. It prompts me for
id. If I enter the id the list box displays correct info. I would like
for it to see what page I'm on in my form take the id from there and
fill the list box accordingly. When I change sheets it would
automatically update. I have pasted sql query below. I would really
appreciate any insight on how to make this work. Thanks ahead of time.


There are no "sheets" in Access. Do you mean when you move to a new
record? If you really want to use a Listbox, it would need to be based
on a query referencing the ID on the FORM (see below); and you would
need to Requery the listbox in VBA code whenever you move to a new
record.

Perhaps Im not making myself clear. I want a list box to show
information from a table in a form. The table is not the table that
main form is driving. I want the list box to see the reservationid from
the form on which ever record is active, and to show only the
information where the 2 reservation id's are =. The list box will work
if I type in reservationid, but it won't get it from the active form
page like I want. Hopefully this bettrer explains problem.


SELECT [reserve].[site], [reserve].[reservationid],
[reservations].[reservationsid]
FROM reserve
WHERE (([reserve].[reservationid])=([reservations].[reservationsid]));


CHange this last line to

WHERE (([reserve].[reservationid]) =
([Forms]![NameOfYourForm]![reservationsid]))

and put the following code in both the Form's Current event and the
AfterUpdate event of reservationsid:

Me!nameoflistbox.Requery

John W. Vinson[MVP]

  #3  
Old December 8th, 2005, 01:51 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default COULD SOMONE PLEASE HELP?

Thnaks for help I did what you suggested and I get the following ERROR.


Microsoft Access can't find the macro 'Me!Lstsites.'

The list box is now showing sites for the first record, when I change
recored I get the above error.
any other help would be apperciated.

Thanks
Dan

  #4  
Old December 8th, 2005, 07:57 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default COULD SOMONE PLEASE HELP?

On 8 Dec 2005 05:51:27 -0800, "deercreek" wrote:

Thnaks for help I did what you suggested and I get the following ERROR.


Microsoft Access can't find the macro 'Me!Lstsites.'

The list box is now showing sites for the first record, when I change
recored I get the above error.
any other help would be apperciated.

Thanks
Dan


Rather than typing the text directly into the control's event line,
click the ... icon by the AfterUpdate event and choose "Code Builder".
Access will give you the Sub and End Sub lines free of charge; just
edit it to

Private Sub whatever_AfterUpdate()
Me!lstSites.Requery
End Sub


John W. Vinson[MVP]
  #5  
Old December 9th, 2005, 12:57 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default COULD SOMONE PLEASE HELP?

That worked thanks for help Really Apperciate It.

Thanks Again!
Dan

 




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 05:25 AM.


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