Hello, I am new here at these forums but I am simply looking for some VB6 coding help…
I am creating an Hour Logging program in VB6 for my school’s tech staff, and I am wondering If you guys could help me out with this problem I am stuck on. I could do it the hard way, or I could just ask you guys if there is an easier way.
Situation:
I have a ComboMenu with a List of Names. This is for Loggin hours under this specific name.
I have an Hours text box, For logging specific hours under each name.
And I have a Job text box, for logging what type of jobs you did during the time.
Here is a screenshot of the main interface:
As you can see, I have an exit button (self explanitory), a clear button, which clears all fields, and “add” button, that adds the information to a specific log, an Options button, which has a few basic options, and a My Log button, for viewing the stored Logs.
My question is, is there an easy way of coding the “add” button, to;
-
Add the Information to the log in an Organized fashion
-
Save the Log for future use
-
Do the above without going through each string saying “if comboname=”" then Add ect… ect… ect…"
I could do it this way, but the problem I would have is this:
Under the “options” menu, I have the option to create another Staff Member. When clicked on, is there a way to have it create another form/log/identity without me manually changing any of the code? I have an idea in my head, but I’d like to ask someone who knows a bit more before I go off exploring…
EDIT:
I got impatient and went off exploring
This is what I am thinking, but it isn’t working:
If comboNames = “Marcus” Then listMarcusHours.AddItem txtHours.Text
Else
Beep
End If
comboNames is the combolist on main interface, listMarcusHours is the list I want to add it to (log), and txtHours is the hours textbox on the main interface… am I goin down the right path here? or is this the hard way? Plus, this isn’t working, I get the “Else without an If!” error, when there is clearly and If there, confused… ?!