473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Run Popup Form under only under certain circumstances

I want to a popup form to automatically open onOpen of my main form but only if dates in an "expiration" field in the main form are within the next thirty days. Does any one have any ideas?
Oct 8 '07 #1
6 1493
missinglinq
3,532 Expert 2GB
Do you mean only if any expiration dates occur between today and 30 days from today, or do you mean if there's any expiration dates on or before 30 days from today?

The second would also include expiration dates that fall prior to today's date. This code will do that:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.  MinExpDate = DMin("ExpDate", "ExpDateTable")
  3.  If MinExpDate <= (Date + 30) Then MsgBox "Due within next 30 days"
  4. End Sub
  5.  
On Line # 3 you would just replace

MsgBox "Due within next 30 days"


with your code to open your popup form.

Welcome to TheScripts!

Linq ;)>
Oct 8 '07 #2
This code seems to work except there are still expiration dates in the field that have already occurred in the past, thus the <= does not work because it will run if there are any dates before today. How would I write the function to exclude these dates?
Oct 8 '07 #3
nico5038
3,080 Expert 2GB
I hate popup forms as they force the user to click them away and then it's "forgotten".
I just add a "To do" subform to my frmMain showing the outstanding rows of the table. Thus the user will always be aware that work still has to be done...

Idea ?

Nic;o)
Oct 8 '07 #4
missinglinq
3,532 Expert 2GB
Okay, this code only checks for expiration dates between today and today + 30 days. It doesn't include dates BEFORE today.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2. MinExpDate = DMin("ExpDate", "ExpDateTable", "[ExpDate] >= #" & Date & "#")
  3. If (MinExpDate >= Date) And (MinExpDate <= (Date + 30))
  4.   Then MsgBox "Due within next 30 days"
  5. End Sub
  6.  
Is this what you need?

Linq :)>
Oct 8 '07 #5
Sounds like a good idea too. I got this code to work so thanks to both of you guys.
Oct 8 '07 #6
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Oct 9 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: dave yan | last post by:
hi, i have some forms which use javascript for data validation, e.g., checking to make sure all required fields are completed, checking that data falls within valid ranges for certain fields,...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
2
by: Mark | last post by:
The situtation is that I'm trying to ensure that certain functions are only called by functions that I want them to be called from. I have a popup window which has a function which calls a function...
20
by: dukeleto | last post by:
I know this is an annoying thing on some sites. I have set some images in an online gallery to have their own java po up window that is set to be the same size as the image. I would like to...
1
by: Alan | last post by:
I am trying to use javascript modal popup windows (window.createModalWindow) to display HTML forms. The problem is - the form size and content varies. The same entry form, under different...
2
by: ortaias | last post by:
The popup form works as expected in certain cases and fails in other cases. I have traced the problem to a query. If the query displays only a limited set of data then the popup form appears to...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
9
by: john | last post by:
In Paradox I was able to create popup menu's in which some of the items had popup menu's themselves. I've looked for threads on popup menu's and access but I can't find how to make a simple popup...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.