Solved

Best way to code something vb6

Posted on 2015-02-24
4
97 Views
Last Modified: 2015-02-24
I have a reminder program that loops thru files that contain a date Eg:
C:\Backups\Tasks\02-20-2016.rtf
C:\Backups\Tasks\02-28-2015.rtf
C:\Backups\Tasks\03-01-2015.rtf
C:\Backups\Tasks\03-10-2015.rtf
C:\Backups\Tasks\03-10-2016.rtf
C:\Backups\Tasks\06-23-2015.rtf
C:\Backups\Tasks\06-23-2016.rtf
the current date is 4 days before one of the dates then a message box displays
Call MsgBox("You have a scheduled task to consider in " & miFirstReminderDays & " days", vbInformation, "Needs attention") and the rtf files is loaded and the form displayed
I have the program run when windows starts invisible and only is shown if a reminder date is found
but i also need to start the program visible to add new items
The only way i could determine a way is to make 2 exeys
one visible and one invisible
Is there another way ?
0
Comment
Question by:isnoend2001
  • 2
  • 2
4 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 40629144
Add a timer to your form and then add this code. with this code the form will show up 1 second after F3 is pressed. You can use any function key that's convenient and you can also make the reaction fater by decreasing the 1000, but the smaller it is the more recourses you will be using up.

Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Private Sub Form_Load()
Me.Visible = False
Timer1.Interval = 1000 ' 1 second
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()

   If GetAsyncKeyState(vbKeyF3) <> 0 Then
      Me.Visible = True
   End If

End Sub

Open in new window

0
 

Author Closing Comment

by:isnoend2001
ID: 40629259
Thanks Marty glad you are here
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40629275
So am I:)  You're welcome.
0
 

Author Comment

by:isnoend2001
ID: 40629284
Lot better than 2 exeys I added this:
Private Sub Form_Load()
MsgBox "Press F3 to open"
Me.Visible = False
Timer1.Interval = 1000 ' 1 second
Timer1.Enabled = True
End Sub
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
change vba from autofit to 13.5 width? 4 29
Adding to a VBA? 6 78
Protecting vb6 & .Net code Obfuscation 18 156
Help me. 3 60
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question