Welcome to the North American Subaru Impreza Owners Club Sunday December 21, 2014
Home Forums WikiNASIOC Products Store Modifications Upgrade Garage
NASIOC
Here you can view your subscribed threads, work with private messages and edit your profile and preferences Home Registration is free! Visit the NASIOC Store NASIOC Rules Search Find other members Frequently Asked Questions Calendar Archive NASIOC Upgrade Garage Logout
Go Back   NASIOC > NASIOC Miscellaneous > Off-Topic

Welcome to NASIOC - The world's largest online community for Subaru enthusiasts!
Welcome to the NASIOC.com Subaru forum.

You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community, free of charge, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, so please join our community today!

If you have any problems with the registration process or your account login, please contact us.
* Registered users of the site do not see these ads.
Reply
 
Thread Tools Display Modes
Old 08-15-2008, 05:51 PM   #1
Spitfire999
Scooby Newbie
 
Member#: 143011
Join Date: Mar 2007
Chapter/Region: MAIC
Location: Arlington - VA
Vehicle:
2012 128i M-sport
Black

Default Access help...can't figure this out...

This is probably really easy, but here is the deal. I have an input form and it has one field where you input a $ value. The engineering guys like to pretend this field isn't there...I want to remind them to fill it out when they don't.

So, when I click the exit button, if that field is blank, I want a message to pop up and say please put something in there.

Quote:
Private Sub CloseForm_Click()

_________________________________

If Final_Price_$ = "" Or IsNull(Final_Price_$) Then
MsgBox "Need pricePrice"
End If
__________________________________

On Error GoTo Err_CloseForm_Click
DoCmd.Close

Exit_CloseForm_Click:
Exit Sub

Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click

End Sub
The part sectioned off is the code I am working on. At the moment when I run that it will always display the message even if it is filled in and then skip to the would you like to save input changes window (I think I may need to use the .setfocus if it is blank).

Final_Price_$ is the name of the input box btw.

Help would be great
Thanks
Ben
* Registered users of the site do not see these ads.
Spitfire999 is offline   Reply With Quote
Old 08-15-2008, 06:01 PM   #2
charlie_tuna
Scooby Newbie
 
Member#: 101713
Join Date: Nov 2005
Chapter/Region: RMIC
Vehicle:
2001 F-150
Work Truck White

Default

I'm not totally up on my VB, but I think that "IsNull(Final_Price_$)" is not the right logical test.
charlie_tuna is offline   Reply With Quote
Old 08-15-2008, 06:09 PM   #3
imprezton
Scooby Specialist
 
Member#: 22958
Join Date: Aug 2002
Chapter/Region: SWIC
Location: Las Vegas
Vehicle:
2011 Land Rover LR2
Gray

Default

Code:
Private Sub CloseForm_Click()

_________________________________

If Final_Price_$ = "" Or IsNull(Final_Price_$) Then
MsgBox "Need pricePrice"
Goto EndSubWithoutClosing
End If 
__________________________________

On Error GoTo Err_CloseForm_Click
DoCmd.Close

Exit_CloseForm_Click:
Exit Sub

Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
EndSubWithoutClosing:
End Sub
Your message logic is fine. The problem is that you do nothing to preven the close operation after you've raised the message.
imprezton is offline   Reply With Quote
Old 08-15-2008, 06:14 PM   #4
Spitfire999
Scooby Newbie
 
Member#: 143011
Join Date: Mar 2007
Chapter/Region: MAIC
Location: Arlington - VA
Vehicle:
2012 128i M-sport
Black

Default

Quote:
Originally Posted by imprezton View Post
Code:
Private Sub CloseForm_Click()

_________________________________

If Final_Price_$ = "" Or IsNull(Final_Price_$) Then
MsgBox "Need pricePrice"
Goto EndSubWithoutClosing
End If 
__________________________________

On Error GoTo Err_CloseForm_Click
DoCmd.Close

Exit_CloseForm_Click:
Exit Sub

Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
EndSubWithoutClosing:
End Sub
Your message logic is fine. The problem is that you do nothing to preven the close operation after you've raised the message.
I felt like my logic was correct as well, but it always displays the message, even if "Final_price_$" is not equal to null.
Spitfire999 is offline   Reply With Quote
Old 08-15-2008, 07:04 PM   #5
imprezton
Scooby Specialist
 
Member#: 22958
Join Date: Aug 2002
Chapter/Region: SWIC
Location: Las Vegas
Vehicle:
2011 Land Rover LR2
Gray

Default

Then try this:
Code:
Private Sub CloseForm_Click()

_________________________________

If Final_Price_$ = "" Then
MsgBox "Need pricePrice"
Goto EndSubWithoutClosing
Else if IsNull(Final_Price_$) Then
MsgBox "Need pricePrice"
Goto EndSubWithoutClosing
End If 
End If
__________________________________

On Error GoTo Err_CloseForm_Click
DoCmd.Close

Exit_CloseForm_Click:
Exit Sub

Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
EndSubWithoutClosing:
End Sub
imprezton is offline   Reply With Quote
Old 08-15-2008, 07:18 PM   #6
imprezton
Scooby Specialist
 
Member#: 22958
Join Date: Aug 2002
Chapter/Region: SWIC
Location: Las Vegas
Vehicle:
2011 Land Rover LR2
Gray

Default

Or this:

Code:
Private Sub CloseForm_Click()

_________________________________

If Final_Price_$ = "" Or Final_Price_$ Is Null Then
MsgBox "Need pricePrice"
Goto EndSubWithoutClosing
End If 
__________________________________

On Error GoTo Err_CloseForm_Click
DoCmd.Close

Exit_CloseForm_Click:
Exit Sub

Err_CloseForm_Click:
MsgBox Err.Description
Resume Exit_CloseForm_Click
EndSubWithoutClosing:
End Sub
imprezton is offline   Reply With Quote
Old 08-15-2008, 07:56 PM   #7
pgtkid
Scooby Newbie
 
Member#: 32810
Join Date: Feb 2003
Chapter/Region: MWSOC
Vehicle:
2006 Impreza 2.5i
Sandstone Metallic

Default

Is the input box connected to a table to which you input that data youre requesting?

If so just go into the table and make that field a required field and access will generate an automated prompt no to leave that field empty.
pgtkid is offline   Reply With Quote
Reply

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't figure this out | Power steering pump problem. Hyelude Factory 2.0L Turbo Powertrain (EJ Series Factory 2.0L Turbo) 2 07-27-2009 01:56 PM
Overheating at low revs. New Thermostat, HG, and waterpump. I can't figure this out. Surestick Normally Aspirated Powertrain 48 07-16-2009 06:38 PM
Oh crap i can't figure this out and I'm teaching it tomorrow Gerkins31 Off-Topic 32 10-09-2007 12:44 PM
ok im sick of this noise, please somebody help me figure this out. BoneStock03 Transmission (AT/MT) & Driveline 2 06-19-2006 03:23 PM
arggggg! Can't figure this out! (recording streaming vid) biggreen96 Off-Topic 4 10-27-2005 06:52 PM


All times are GMT -4. The time now is 11:22 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Powered by Searchlight © 2014 Axivo Inc.
Copyright ©1999 - 2014, North American Subaru Impreza Owners Club, Inc.