 |
| Access VBA Discuss using VBA for Access programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 11th, 2003, 05:15 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What is triggering your frmPopUp and the Macro. Are any of this referencing your frmSpecial_Events form?
The error is comming right when you add the record. Is this macro linked to yghour table in any way?
Sal
|
|

November 11th, 2003, 05:39 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have a macro, attached to the frmPopup, that requeries (On Activate) the qryNow. To "Reruns the query on which the control or object is based."
The frmPopUp Record Source is qryNow. It counts the number of events for the current date, ">=Date() And <DateAdd("d",1,Date())", in tblSpecial_Event .
"What is triggering your frmPopUp . . ." Tools/Startup/Display Form/Page:frmPopUp.
"The error is comming right when you add the record." Yes and when I open the form.
I'm leaving in a few minutes to tutor a student, in FrontPage, at our local community college.
Bob
|
|

November 11th, 2003, 06:01 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
First. Try not to use the macro. On the form's Activate event requery the form. Macros are too buggy. I tried replicating on my side and it gave me problems.
The 1 of 1 or 1 of 2 is not an issue. the records are being added to the form and the form is showing 1 of 1 added, 2 of 2 added, etc.
Sal
|
|

November 11th, 2003, 08:57 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sal,
I realize that the 1 of 1 and 2 of 2 isn't the issue, but why does that message "Special Ticker Event can't find the Macro'.' The macro (or its macro group) doesn't exist . . . . ." come up.
Yes, the records are being added, but the user doesn't want to see that message everytime he opens the form or adds a new event.
If there is a way to .zip you a copy of my database, you'll see why I'm really frustrated.
I have a half a notion to start over and see what happens.
Bob
|
|

November 11th, 2003, 09:43 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You could e-mail me a stripped down version with no data just the table and two forms. My e-mail is [email protected]
Somehow this re-quering is happening when you add the record and open the form, but without looking at it it is hard to say what is going on.
I will be glad to take a look at it.
Sal
|
|

November 12th, 2003, 11:24 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I see one thing wrong under On Activate there is a reference to a Now item. This may be the code/macro that the form is looking for.
I noticed is that you named your date field âdateâ. VB can have problems with this. Date is a reserved word.
When you import objects (forms, reports) containing code into a database, you can get this type of problem also, so when you import, copy the code from the form/report and paste it into notepad. On the form/report properties make sure to select Has Module = no. Save the changes. Now import the form/report into the database and paste the code from notepad into the vbe. After doing this, make sure that all objects in the forms/report have their event procedure selected under properties. If they do not, click the ...elipsis and make sure that they get their [Event Procedure].
Did you import the items from your database to this sample database?
Sal
|
|

November 12th, 2003, 11:58 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The count is wrong because you need to use
count = DCount("Date", "qryNow", "Date = " & MyDate)
not
count = DCount("Date", "tblSpecial_Event", "Date = " & MyDate)
to show tomorrows date do this
DateAdd('d',1,Date())
Sal
|
|

November 12th, 2003, 04:07 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sal,
After thinking "really hard", I don't know why I had that macro (requery).
Everything is working fine. No more "Special Ticker Event can't find the Macro'.' The macro (or its macro group) doesn't exist . . . . ."
I also get an accurate count, whether I use the Tab key or just Close Form. I double check the table to make sure.
I will try your suggestion "count = DCount("Date", "qryNow", "Date = " & MyDate)" and see what happens.
I'm sending you another .zip of the STE. I have a couple of questions, but if you prefer not to, that is okay, too.
1.) If I delete a record, I need to update the label "You have 6 Event(s) today" to show 5 4 3 2 or 1 Do you have any suggestions? Just suggestions! Just point me. I like to do it myself and if I get into trouble then start seeking.
2.) Can you give me some suggestions/pointers about the SNOOZE? I hit SNOOZE and it refreshes the label and makes the date in the Date field a day later. To pop up tomorrow!
Thanks in advance,
Later,
Bob
|
|

November 12th, 2003, 04:27 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sal,
I've solved the problem with the updating the Label after deleting the Record!!!!!!!
Working on the SNOOZE.
Will post questions If I run into problems.
Bob
|
|

November 12th, 2003, 04:37 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Snoozing is just using an alternate time field greater than the date field by some increment, % minutes, one day) or just changing the original date field and incrementing it (but I would not suggest to change the original field value)
Sal
|
|
 |