?
Solved

Best way to code something vb6

Posted on 2015-02-24
4
Medium Priority
?
104 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 50

Accepted Solution

by:
Martin Liss earned 2000 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 50

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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

839 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