Forms and Macro A 2010

Dick7Access

Dick S
Local time
Yesterday, 21:32
Joined
Jun 9, 2009
Messages
4,325
Hi all,
I have a problem that I have been trying to solve on and off for 4 weeks. It is driving me crazy. I have a form with command buttons representing a bunch of years. By clicking on a button it opens a form that shows all the meeting I had for that year. The buttons have an embedded macro that opens the meetings form and then calls a query that filter that chosen year. If I click say 1995 or 96, 97 – 99 2000 it works fine. 98 only pulls up one meeting in 1997, but nothing for 98. The query by itself pulls up all of the 98 meetings. I have reentered the filter name numerous times I have tried new buttons, even a new meetings form, nothing works. I can’t think of anything else to try. Anybody have any ideas?
 
I had similar problems when using embedded macros. Reverted back to good old VBA and all was fine. I suspect the embedded macros don't quite work as advertised and am hoping a proper SP1 will fix the issues (not the current broken version)

Try as I did and drop the macro, open your form and run the query using VBA.

Or

Use the query as the RecordSource on the form and then all you have to do is open the form ( I think the macro should be good for that single task)

SmallTime
 
Thanks I will give it a try.
 
Rather than reply to your PM, I'll post here, to keep info on the thread. Can you post the db, or a representative sample?
 
http://www.mediafire.com/file/2bk9duwh56j5wyv/testTryFix.zip

Paul and all others,
Here is the best I can do. The file is too big to add as an attachment. I have upload a zip file to Media Fire. If anybody has the time and would be interested in helping me find what I am doing wrong and help me to learn access better I would appreciate it very much.
Here is the problem stated again: If you will open the file it should autoexec to frmMain. From there if you will click meetings at the bottom it should go to frmMeetingsMenu. From there clicking (All Meetings) will open frmMeetings and show all the meetins. CmdButtons 1993 to 1997 all work fine with embedded macros calling the respective queries. 1998 doesn’t work. I have not coded anything past 1998. I have tried deleting the embedded macro and entering a new one, I have tried a new CmdButton for 1998. I have tried a new frmMeetings, nothing works. Someone recommend I try VBA but I am weak in that area and besides if the embedded macros work for 93 to 97 why won’t they work for 98. Any help would be appreciated. Thank You in advance.
Dick S,

 
Well, it's definately not how I would do it, but the 1998 button pulls up 44 records, all with a 1998 date.
 
Paul,
I am confused. My copy dose not pull up 98 dates. Did it pull up the 98 date right away, or did you make a change.
Also Did it take very long to download, as it took me 12 minutes to upload
What is the (definately not how) I am always intrested in learning?
 
It works "out of the box"; I didn't change anything. Does yours say "1 of 44" at the bottom? I'd point out that the date field on the form ("Date/Meet") isn't populated for those records. If you add a textbox for the "Date" field, you see the date.

As is the file is 125Mb, which is pretty big. After a compact/repair, it's half that size, but still 63Mb. My guess is that the various OLE fields are the reason for the size. I've never used one. I store a path to a file stored outside the db, but that works for what I need. You're storing them inside the db, so it's bound to be large.
 
Paul Thanks,
Did you try any of the dates 93 to 95 they work fine and are populated the Date/Meet has a source of datmeet. If they are populated for 93 to 95 why not 98, same form, same enbedded macro/ I missed that the bottom line said 44. Mine does also. Its finding 44 meetings but not showing on the form. Beats me.
 
If I sort descending on that field (in the table or in qryAlpha), the most recent date is in 97 and MOST of the records have no value in that field.
 
Paul,
Could not get back to your right away, I am working the Gregg County Fair in Longview, TX and had to go out there.
Yes I went into the table (tblChurches) and it does have a field datmeet and it really should not be there, which is one of the reason I am trying to normalize this db, to get rid of junk. However the frmMeetings is populated not from qryAlpha or the tblChurches but from qryMeetingsAll which is a join from qryAlpha and tblmeetings. The datmeet there is not the one from the table, but the one from the qryMeetingsAll, which the record source for datmeet is from the tblMeetings side of the join. If you run the qryMeetings 1998 you will see it pulls up all the 1998 meetings. The form frmMeetings for all years gets populated from the same qryMeetingsAll, the only thing that is different is the filter in the embedded macro, and I have checked that over and over. If some dates work so should 1998.
 
I'm not sure what to tell you. On my computer it is correctly bringing up the 1998 dates. What is it you're not seeing on the form exactly? The datmeet field is what's being displayed on the form, not the date the filter is based on.
 
Paul,
Thanks for helping.
Wow this is weird. Let see if we are talking about the same thing. From frmMain which opens via autoexec I click Meetings, which opens frmmeetingsMenu, from there I click 1998, which opens frmmeetings which is identical to frmMain except it had a field just below the ChPh named Date/Meet. With the click of 1998 the Date/Meet is empty except for record 25 (Pine Air Baptist Church) which has a date of 6/1/97. The record count indicator at the bottom does show 44 records. With the buttons 93 to 97 the Date/Meet field show the date of each meeting. If that is what you are doing and the Date/Meet field is populated then it has to be something with my copy of Access. I think I am going to take up knitting.
 
I'm not saying the datmeet field is populated. I'm saying it isn't the field that's relevant. Like I said, there are no records with dates beyond 97 in that field, and most of the records have nothing in it. The field you're filtering on is different, so you have a somewhat confusing setup of filtering on one field but displaying another. Change that textbox or add another bound to the field being filtered on, and see if the results make more sense. Your db is on my other laptop which is off right now, so I can't remember the name of that field.
 
Your wife is always right...so is mine...I think they all are. :p

I assume that means you got it sorted out? I can't look at the file right now.
 
Yes, I was using the field for the date from the table tblChurches when I should have been using the date field from the table tblMeetings.

<G> Unforunatly I open your message in full view of my wife.
 

Users who are viewing this thread

Back
Top Bottom