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 |
#11
|
|||
|
|||
Next Issue....records between dates
On Tue, 12 Jan 2010 15:22:22 GMT, "thewabit via AccessMonster.com"
u57141@uwe wrote: John, That was the problem. I had the form set to close. I reprogrammed the button to only open frmLOSA_Review and it works fine. It's sometimes useful to have the button set the button's own form's Visible property to No. It vanishes from the screen but its parameter values are still available. You should close the calling form in the Close event of the called form (or report) if you do this. Kind of related, in frmLOSA_Report, I have the calendar popup to fill in the startdate and enddate and it seems to work fine. But in the Code screen, I do a compile and I get a syntax erroron this: =CalendarFor([StartDate], "Select the sale date") Any ideas? I've never seen a function named CalendarFor; is that a custom routine in your database? If so post the code. -- John W. Vinson [MVP] |
#12
|
|||
|
|||
Next Issue....records between dates
On Tue, 12 Jan 2010 15:34:12 GMT, "thewabit via AccessMonster.com"
u57141@uwe wrote: Next question...On that same frmLOSA_Report form is some other filter criteria I.E. I can select to only display records by observer name via a combobox and some radio buttons to display records grouped by comments. To get the date to work, we based the display form on a query and filtered the date column. How do these other criteria boxes and radio buttons come into play? In other words, can I filter by date AND other things? if so, how? Any query can have multiple criteria. Just open the query in design view and apply criteria just as you did for the date. The details will depend on the nature of the query that you want to run. -- John W. Vinson [MVP] |
#13
|
|||
|
|||
Next Issue....records between dates
I'm not sure what that code is. It's on another button in DB...that's what
happens when I experiment too much. But hey, that's how I learn. Let me make sure I understand. In the Close event of the form that is displaying my records, set it to close the previous form? John W. Vinson wrote: John, That was the problem. I had the form set to close. I reprogrammed the button to only open frmLOSA_Review and it works fine. It's sometimes useful to have the button set the button's own form's Visible property to No. It vanishes from the screen but its parameter values are still available. You should close the calling form in the Close event of the called form (or report) if you do this. Kind of related, in frmLOSA_Report, I have the calendar popup to fill in the startdate and enddate and it seems to work fine. But in the Code screen, I do a compile and I get a syntax erroron this: =CalendarFor([StartDate], "Select the sale date") Any ideas? I've never seen a function named CalendarFor; is that a custom routine in your database? If so post the code. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201001/1 |
#14
|
|||
|
|||
Next Issue....records between dates
On Wed, 13 Jan 2010 03:20:16 GMT, "thewabit via AccessMonster.com"
u57141@uwe wrote: I'm not sure what that code is. It's on another button in DB...that's what happens when I experiment too much. But hey, that's how I learn. Open the VBA editor and use the binoculars icon. Search "Current Project" and you should be able to find the code. Or, select the CalendarFor line and right mouseclick, and select "Definition". Several ways to find the actual code! Let me make sure I understand. In the Close event of the form that is displaying my records, set it to close the previous form? Yes; a line DoCmd.Close acForm, "frmLOSA_Report" will do so. -- John W. Vinson [MVP] |
#15
|
|||
|
|||
Next Issue....records between dates
Thanks for your help on this John. Hopefully, talk to you soon with my next
issue. This is a big project. John W. Vinson wrote: I'm not sure what that code is. It's on another button in DB...that's what happens when I experiment too much. But hey, that's how I learn. Open the VBA editor and use the binoculars icon. Search "Current Project" and you should be able to find the code. Or, select the CalendarFor line and right mouseclick, and select "Definition". Several ways to find the actual code! Let me make sure I understand. In the Close event of the form that is displaying my records, set it to close the previous form? Yes; a line DoCmd.Close acForm, "frmLOSA_Report" will do so. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201001/1 |
#16
|
|||
|
|||
Next Issue....records between dates
I am using Allan Browns calendar. It seems to be part of the module he has
you download and put in your DB. heres the part flags. Public Function CalendarFor(txt As TextBox, Optional strTitle As String) 'On Error GoTo Err_Handler 'Purpose: Open the calendar form, identifying the text box to return the date to. 'Arguments: txt = the text box to return the date to. ' strTitle = the caption for the calendar form (passed in OpenArgs). Set gtxtCalTarget = txt DoCmd.OpenForm "frmCalendar", windowmode:=acDialog, OpenArgs:=strTitle John W. Vinson wrote: I'm not sure what that code is. It's on another button in DB...that's what happens when I experiment too much. But hey, that's how I learn. Open the VBA editor and use the binoculars icon. Search "Current Project" and you should be able to find the code. Or, select the CalendarFor line and right mouseclick, and select "Definition". Several ways to find the actual code! Let me make sure I understand. In the Close event of the form that is displaying my records, set it to close the previous form? Yes; a line DoCmd.Close acForm, "frmLOSA_Report" will do so. -- Message posted via http://www.accessmonster.com |
#17
|
|||
|
|||
Next Issue....records between dates
I added an additional filter to filter by "observer". So I had the " date"
filtered and the "observer" ..It worked great...the first time. When I went back in to do it again, it returned no records and the "Date field of the viewing form had the #name? thing. Did I need to put a requery somewhere? John W. Vinson wrote: Next question...On that same frmLOSA_Report form is some other filter criteria I.E. I can select to only display records by observer name via a combobox and some radio buttons to display records grouped by comments. To get the date to work, we based the display form on a query and filtered the date column. How do these other criteria boxes and radio buttons come into play? In other words, can I filter by date AND other things? if so, how? Any query can have multiple criteria. Just open the query in design view and apply criteria just as you did for the date. The details will depend on the nature of the query that you want to run. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201001/1 |
#18
|
|||
|
|||
Next Issue....records between dates
On Thu, 14 Jan 2010 00:50:12 GMT, "thewabit via AccessMonster.com"
u57141@uwe wrote: I added an additional filter to filter by "observer". So I had the " date" filtered and the "observer" ..It worked great...the first time. When I went back in to do it again, it returned no records and the "Date field of the viewing form had the #name? thing. Please post the query and your code. -- John W. Vinson [MVP] |
#19
|
|||
|
|||
Next Issue....records between dates
SELECT tblObservations.ObID, tblObservations.Observer, tblObservations.
ObEmpID, tblObservations.ObDate, tblObservations.ObFrom, tblObservations.ObTo, tblObservations.FlightNumber, tblObservations.ScheduleBlock, tblObservations. ActualBlock, tblObservations.Captain, tblObservations.CaptainEmpID, tblObservations.CrewBase, tblObservations.FirstOfficer, tblObservations. FirstOfficerID, tblObservations.FirstOfficerCrewBase, tblObservations. AircraftTailNumber, tblObservations.AircraftType, tblObservations.LineCheck, tblObservations.ObRemark, tblObservations.Approach, tblObservations. P1_VerticalSpeed, tblObservations.P1_Course, tblObservations.P1_Glideslope, tblObservations.P2_VerticalSpeed, tblObservations.P2_Course, tblObservations. P2_Glideslope, tblObservations.P2_Airspeed, tblObservations.P3_VerticalSpeed, tblObservations.P3_Course, tblObservations.P3_Glideslope, tblObservations. P3_Airspeed FROM tblObservations WHERE (((tblObservations.Observer)=[Forms]![frmLOSA_Report]![Observer]) AND ( (tblObservations.ObDate)=[Forms]![frmLOSA_Report]![StartDate] And (tblObservations.ObDate)DateAdd("d",1,[Forms]![frmLOSA_Report]![EndDate]))); John W. Vinson wrote: I added an additional filter to filter by "observer". So I had the " date" filtered and the "observer" ..It worked great...the first time. When I went back in to do it again, it returned no records and the "Date field of the viewing form had the #name? thing. Please post the query and your code. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201001/1 |
|
Thread Tools | |
Display Modes | |
|
|