PDA

Click to See Complete Forum and Search --> : Couple of Newbie questions


Trick
Jan 23rd, 2000, 01:21 AM
Ok, I have a few easy ones for everyone here, I'm sure. I just started in VB, and am waiting on my employer to get me the full version so I can have the Online Help :)

My program is a simple one that helps schedule employees. It starts by asking the date and the shift that the user wants to schedule.

#1: How do I get VB to save this schedule automatically by using the date and shift for reference? For instance, the filename might be - 0123003. Where the first 6 digits are the date and the 7th one is the shift. It uses a date picker for the date, and a combo box for the shift.

#2: This one is a little harder to describe, but I'll try to boil it down into something simple - How would I send the result of the Shift selection to a simple textbox? For instance, if the user picked "Evenings" I would like it displayed in a text box below it. (That isn't what I'm doing, but it should help me figure out how to carry the value around in the program.)

Thanks in advance for any help. I realize these are simple, but if the purchasing department would hurry up, I'd have my full version!



------------------
Greg Trickey

Lior
Jan 23rd, 2000, 02:01 AM
Well...for the first task use the function:
STR$ , this helps you converting integer values into a string, and the function VAL helps you to do just the opposite.

about your second question, u just need to find where the value "evenings" is saved (let's say: it is saved in the A varialbe) then all you have to do is:

Text1.text = A

I hope i understood your questions correctly and my answers would help you.

------------------
------
God:
------
Oh...those israeli programmers..!

Trick
Jan 23rd, 2000, 03:26 AM
Thanks for the reply. It did help a bit...

#1: Ok, the VAL function will work to change "Evenings" into a value. However, I need to save the compiled roster. Essentially, the program takes the date, the shift, and the User inputed ID's and displays a roster for that day. I need to save this roster somehow so it can be accessed later. I could use a File Save As box, but would rather have VB do it automatically so the same naming convention could be used.

#2: How do I get VB to assign the value of the Shift selection? I have tried several variations.

For instance, the combo box for the shift selection is cboShift. Is the value stored in cboShift.Text? Couldn't I just use txtShift.Text = cboShift.Text?

Again, I only have minimum documentation as I'm using the Learning Edition for now. Which brings up another question: If it's the Learning Edition, isn't that the most logical edition for having the help files available? :)

Thanks for the reply!

------------------
Greg Trickey


[This message has been edited by Trick (edited 01-23-2000).]

Serge
Jan 23rd, 2000, 09:02 PM
For your first question, can you be more specific? I'm little confused. Are date and a shift would be stored in one string (i.e. as one experession)?

For your second question you can do something like his:
txtShift.Text = cboShift.List(cboShift.Listindex)

------------------

Serge

Software Developer
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)