?
Solved

Best way to code something vb6

Posted on 2015-02-24
4
Medium Priority
?
101 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 49

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 49

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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