Off Topic Cafe If it doesn't belong in any of the other forums. Post all Off Topic stuff here.

Help With Vb Script

Old Dec 16, 2005 | 02:10 PM
  #1  
Visionz's Avatar
Thread Starter
Administrator
 
Joined: May 2001
Posts: 23,226
Likes: 9
From: Upstate NY
Vehicle: 2010 Genesis 2.0T
Default

Does anyone know where I can find a code for a Reminder Pop Up, thats in vbscript?

I'm helping out a friend who is designing a database thats in Microsoft Access. There needs to be a pop up warning box if a certain field isnt filled out in a form, and the best way to do it in Access is to program this particular pop up in vbscript.

So any help would be much appreciated. smile.gif Thanks.
Reply
Old Dec 16, 2005 | 02:26 PM
  #2  
Ericy321's Avatar
Senior Member
 
Joined: Mar 2006
Posts: 7,799
Likes: 0
Vehicle: 2001 Hyundai Tiburon
Default

Damn I wish I could remember but I havent done VBScript in a while. I know what youre talking about tho
Reply
Old Dec 16, 2005 | 02:31 PM
  #3  
Visionz's Avatar
Thread Starter
Administrator
 
Joined: May 2001
Posts: 23,226
Likes: 9
From: Upstate NY
Vehicle: 2010 Genesis 2.0T
Default

Even if you know of a site where I can go to, to find the codes....that would be alot of help. I looked online at a few sites, but they didnt have anything for reminder pop ups. sad.gif
Reply
Old Dec 16, 2005 | 04:21 PM
  #4  
brian01tib's Avatar
Senior Member
 
Joined: Mar 2006
Posts: 1,864
Likes: 0
Vehicle: 2001/Hyundai/Tiburon
Default

I havent done vb in 2 years but just looked around and it said some stuff about having to write a code to throw an exception. Ive been doing java for awhile now and it has cade thay throws an exception. Maybe make another program like little box or whaat ever they have in vb and have a method call it to open.


heres some code I found on google, (dont say he didnt search, I just knew the trems that are used):

Dim a As Integer = 2147483647
Dim b As Integer = 0
Dim c As Integer = 0

Try
a += 1
Catch exc As DivideByZeroException
Console.WriteLine("Error: Divide by zero")
Catch exc As OverflowException
Console.WriteLine("Error: Overflow")
Finally
Console.ReadLine()
End Try

hope this helps

heres some search results http://www.google.com/search?hl=en&lr=&q=v...basic+exception

It should be in his vb book
Reply
Old Dec 16, 2005 | 05:15 PM
  #5  
a_gut's Avatar
Senior Member
 
Joined: Jun 2004
Posts: 575
Likes: 0
From: Phoenix, AZ
Default

Use the MsgBox() command in the GotFocus event of whatever box you want to control. It'll look something like this:

fieldA_GotFocus

If IsNull(Me.fieldA.Value) Then

Dim result As Variant
result = MsgBox("FieldB cannot be left empty", acDialogOkOnly)
Me.FieldB.SetFocus

End If

End Sub



If you do a search for MsgBox in the VB code builder, you should be able to find the description and figure it out.
Reply



All times are GMT -6. The time now is 12:54 AM.