Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Simple Database Program

I'm new here and thought this looked like the best place to get help. I hope someone out there is willing. I am somewhat familiar with VB6 but by no means advanced, and here is what I want to create. A program to contain 5 lists, the lists will have names of people. I want then to be able to double click a name to remove it. I figured a database would be easiest to store all the names but I don't know the code to remove the names with a double click or if that's even possible. I figure it should be simple enough and if someone could help me get started that'd be great, thanks a lot!


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Simple Database Program Need Help
Hi expert , i am new to database programming in vb, and i just wondering that anyone can give me the full example of how to create a database application such as address book, telephone book or something else like this using vb and ms sql server. An explaination in how to connect to the server using Data enviromnent and how to retrieved the data you wanted from the server using sql statement would be great
Thank you so much for your help.

Does Any1 Have A Simple Login Program Using Database??
I need a simple login program using database. Just userID and password...

Can VB Read And Write A Simple Database Into XML? Need A Simple Sample.
hi, i was thinking of storing my database info into a XML file.
i was told that XML is better than .mdb, and i dont have MySQL, plus i really wanted to try out and see if i could use XML instead.

please provide me a simple and small sample.

table1 (Login)
- Field1 (Username)
- Type (String)
- Field2 (Password)
- Type (Integer)
- Field3 (Exist)
- Type (Boolean)
- Field4 (Date)
- Type (now(dd,mm,yy))


Simple Simple Database Need One
Can anyone help me with a really simple database

I need a fair bit of information in it like names addresses date of birth, dates, monies paid, etc.

I have used access but it was already set up and don't feel confident to set up from scratch.


Need Help On Simple Program.
Hey, I'm pretty much a newbie at VB, but I do know some of the basics and as a first real program I'm trying to make a (simplified of course) copy of minesweeper, sort of a bet with peanutman.

I've gotten some things to work, but i just can't think of a good routine to detect how many bombs are in the surrounding squares.

I use 2 control arrays (labels), 1 to simulate the buttons and the other for the underlying numbers or bombs. I do have some idea as how to do it, but I have no idea as how to make it so that it works for the squares at the edges. Btw, I do have a routine to place the bombs.

Oh, I've just noticed labels don't support right-clicking, any thoughts on how to solve that problem?

Any comments, ideas, whatever would be very greatly appreciated.

Need Help With Simple Program...
Hey guys im new here, and im talking a VB class at school. I have to do this program that is due and its really simple, but with the way my school is set up, we have to learn 2 days of stuff in 1 day , so it gets really hard to understand the code.

Anyway, i have to make a program that displays the first 3 letters from a name like Bob John Smith. And the middle initial has to be capatilized. I dont have a book at home to help me, so thats why im asking you guys.

So if someone could help me out, id really apperciate it


Help With Very Simple Program

I'd like to make a VB program that simply opens two OTHER programs I have on my computer, and then unloads itself.

I basically want an icon on my desktop that opens two programs with one icon...

I know a bit (keyword bit...) of Basic, but I'm not sure how to do this.

I'm assuming this is simple enough that someone could just post the code here with *insert directory here* or something like that for the two program file locations??

Any help is appreciated!

Cap'n Bob

Help, Simple Program
Create a new Visual Basic project, with one properly named command button and one text box, this is ok no problem with

Add code to the command button (captioned Go!) (no problem too) so that the computer will use for text boxes, to ask for 4 numbers
and then put their sum in the text box.

Any ideas?

SImple Program Help!!!!!!!!!!!!!!!
I am so lost on this and i need someone to help or write this program for me...i can pay you or whatever youd like in return...i am so lost...can someone please help is the program........i can show email you what the form is supposed to look like...please i am just some girl trying to get thru prereqs to get my degree and programming is so confusing for me..this is my last prgramming class and im done and go on to things i can do...

here is the program....

a company sells lumber, like 2*4, 2*6, 2*8, in lenghts like 8', 10',12', and 14' and is priced by the foot. create a program to determine totl feet and totol cost for each fo lumber. the form, which i can email to you to show u what it looks like, should be divided into input and an output using to shapes. input area needs a label for the customer name and a corresponding text box. create 3 check boxes for diff types of lumber-2*4, 2*6,2*8. each is sold in the four lenghts above. Also need to create a check box for each lenght of each product. to simply, use a control array for each procedure length. so there will be a control array of check boxes for 2*4, 2*6,2*8.Each check box will have a corresponding text box in which to specify qnty desired; these boxes should also be control arrays. all orders are delivered to one of 4 areas. a charge is calclatd based on # of feet and dlivery the output sextion, create labels to hold # of feet of each product and total cost. another label to hold delivery total and order total. charges for lumber based on feet orderd. 2*4=.16/foot, 2*6=.22, 2*8=.31...these are constants. program needs 3 command buttons, one to compute order total based on input, another to clear fields for new order, and an exit one....k?....easy enuff? me with any questions...thank you so much....

Help On Simple VB Program.
Hello I am a noob at programming and want to ask you skillful coders a few questions. I am working on a highschool project but I dont know the least about VB.

My question is I am trying to write a program that displays a light bulb when the buttons are pressed. Also the text changes on the buttons from "OFF" to "ON" corresponding to the status of the light bulb's visibility. I got that part down but what I'm having touble with is the project requires the light bulb to be oFF when both of the button's text is "ON" and the bulb turns on when there is a combination state of OFF and ON.

Here is what I got so far:

Public Class Form1

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

PictureBox1.Visible = Not PictureBox1.Visible
If Button2.Text = "OFF" Then
Button2.Text = "ON"
Button2.Text = "OFF"

End If

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.Visible = Not PictureBox1.Visible
If Button1.Text = "OFF" Then
Button1.Text = "ON"
Button1.Text = "OFF"

End If
End Sub
End Class

I try to add the lines:

If Button1.Text And Button2.Text = "ON" Then
Picturbox1.Visible = False
Picturebox1.Visible = True

so that this would make the picture disappear when the text on the two button is equal to "ON" but when I compile it gives me error saying "cannot change string "OFF" to type boolean".

Any help would be much appreciated. Thank you.

Simple Program
Hi. I want a simle program in vb in which there r two text box. If u enter the data and click submit button then the text should be sent to a particular email address? Should i use winshock. can u give me the code?

Need Help With This Simple Program.
I just started programming in VB, so I guess you will laugh at my dilemma with this program. It manages files and runs them but will only run .exe files.
I am trying to have it opening and run PDF files but just can not get it to work. How about some hints so I can advance to my next exercise.

I have attatched the project to this post - hope it sticks

Any advise appreciated.


Simple Program
Hi there,

I want to make a simple program to keep all my game and program serials in.
I want to us a combo box to show all the names and a text box to show the serials.
How do I go about this?


Simple Program
Hello i had an vb exam and there was a question which I answered 90% of it but couldn't know how to continue it..

Its something like this, Write a program "Guess Game" that you should give a vaiable any value, and then prompt the user "inputbox" to enter a number then if its like the first var then msgbox "Correct!" if not then the user have 5 chances to try again and it shows him "Try again, after it is 6 send a msgbox "Game over"

dim x=11 'lets say its eleven.
dim i
i=inputbox("Enter a number:","Guess Game")
if i=x then

can you complete it from here

Thanks in advance,

Help With Simple Program
hi, i need some help. i am making a simple program fro school where you enter your name and number of pieces complted. then press the calculate button. i have the calculatiion done, with nested If statments, but the trouble starts when it comes to validation. i want to make sure that a name is enter, and will not calcualte unless one is given. if one is not given a msgbox should display. i want to do tha same for the pieces text. if anyone can help it be apperciated, if you need to see a copy of my code or even my form, i can email you it, just let me know.

-thanks justin

heres my far.

Private Sub cmdCalculate_Click()
mintPieces = Val(txtPieces.Text)

'Perform comparisons and calculations.
If mintPieces > 199 Then
If mintPieces > 399 Then
If mintPieces > 599 Then
mcurDollars = mintPieces * 0.65
mcurDollars = mintPieces * 0.6
End If
mcurDollars = mintPieces * 0.55
End If
mcurDollars = mintPieces * 0.5
End If

'Format and display current pay.
lblDollars.Caption = FormatCurrency(mcurDollars)

'Enables the summary button onced clicked.
cmdSummary.Enabled = True

End Sub

Another Simple Program.
I need to make a program that will take about 10 numbers (max)(put in by the user) and find the average in it. can anyone help me?

Simple Program
I need to run a simple program that does some deleting and copying. A customer needs this because a db is becoming corrupted.

Basically I need to:

1)First make a backup of the file located in d:lahme.mdb
2)Delete d:lahme.mdb
3)Take a new copy from c:lahme.mdb and copy it into d:lah

FileCopy to copy files...but how do I delete a file.

VB Code:
FileCopy "d:lahme.mdb" "c:ackupsme.mdb"'need to delete hereFileCopy "c:lahme.mdb" "d:lahme.mdb"

Like this????


I Need Help With A Program, It's Simple
here are the parameters:
The input is a list of names. Convert each letter of each name to a monitary amount according to this table
"A = .01; B = .02 ..."
Add the amounts of the letters of each name to obtain the total for the name. Then print the names and their corresponding amounts in decreasing order.
Example Suppose the list is Sam, Abbie, Jim, Dot. Then the output is this:

Name Amount
Dot .39
Sam .33
Jim .32
Abbie .19

PLease, if anyone could assist me with tis program, I would appreciate it very much

Simple Program
I need a simple program that will allow me to clock in and clock out with the simple click of a button. This program would need to run in the taskbar.

Does anyone know where I can find a script like this that would be a starting point? I could then modify it as needed.

If there is no script out there where do I start?

Thank you!

Simple Program

A friend has asked me to help him with his program, I do not have very much VB knowledge so I thought I'd ask you good people if you could have a quick look for me.

I have uploded the files, if you could have a quick look and possibly get some ares functional or give me some feedback I and he will be very greatful.



Need Help With Simple Program
In my program, a user enters a SKU number and my program goes to an Inventory table and retrives the corresponding info. Im new to this sort of programming, so Im a little confused. Here is what I have below, and when I try to run it, it highlights the line that reads "if (rst.EOF) then" and says 'Operation not allowed when object is closed' I read something about chDrive, chDir, and App Path. Im clueless at this point, please help.

Dim conn As ADODB.Connection

Private Sub Open_Database()
Set conn = New ADODB.Connection
With conn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "CashSales.mdb"
End With
End Sub

Private Sub Read_Database()
Dim strSKU As String
Dim strDescription As String
Dim strUnitPrice As String

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
strSQL = "SELECT * FROM Inventory WHERE SKU ='" & txtSKU.Text & "'"
With rst
.Source = strSQL
.ActiveConnection = conn
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
Do Until .EOF = True
strSKU = !SKU
strDescription = !Description
strUnitPrice = !UnitPrice
End With
If (rst.EOF) Then
MsgBox "SKU not found", vbInformation
End If

End Sub

End My Own Program (This Isn't Simple)
I have a question. I have made a program wich is over 1.5 mb. It uses a lot of memory. The problem is I can't stop the program. If I use the END function it looks like it stopped but if I press ctl-alt-del I se it is still in the memory. If I try to first give free all memory the program hangs. PLeas help because it is iritating (maybe with a function from a dll or something)

Simple Program...
could someone write me a code for a program that will:
Create an odd numbers sum application that displays the sum of the odd numbers from 1 to a maximum value entered by the user. ex. txtNumber = 11, after pressing command button, the answer in the label box would be 29.( 1+2+3+5+7+11 = 29)
Please help me with that program cause it bugs me alot.
Ps. is there a good book that teaches you everything about loops, and other calculating options?

Simple GUI Program
m just starting out on VB and C++.
Not sure which to use.

Im looking to create a GUI interface program that calls on an external cmd line application to convert a file from xml to html.  What I need it just to have the user be able to select the source XML file with a browse button.  Then select with another browse button where to output the convrted file. Then hit a "Go" Button run the process

A) Select a file from the hardrive

B) The project would pass the file name to and external application with two arguments(input filename, output directory)

Im assuming I want to use the shell statement

So I would be passing the original XML file name selected (file.xml) and passing the output directory to the application. Then user would select GO and the external appliction would convert file.xml to file.htm and save it to the output directory.

Simple Chat Program
I'm making a simple chat program so that me and my dad can chat to same the dinner is ready for instance. I have used this code:
Private Sub cmdConnect_Click()
' set up the Winsock properties
' and start the connect sequence
With Winsock
.RemoteHost = ""
.RemotePort = "12345"
End With
End Sub

Private Sub Winsock_Connect()
' we're connected
MsgBox "Connected to: " & Winsock.RemoteHostIP
End Sub

Private Sub sckMain_Error(ByVal Number As Integer, Description As String, _
ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, _
ByVal HelpContext As Long, CancelDisplay As Boolean)
' alert the user to the error
MsgBox "Error: " & Description
End Sub
But each time I click the command button it comes up with an error:
Runtime Error: '424'
Object required and debugs highlighting

Private Sub cmdConnect_Click()
' set up the Winsock properties
' and start the connect sequence
With Winsock
.RemoteHost = ""
.RemotePort = "12345"
End With
End Sub

What am i doing wrong?

Help Simple Back Up Program
I am trying to back up data from a POS system. It is going to go through a network to a different computer.

I have it drawn out with 7 chk boxes one for each day of the week. i want it fist to check and see what box is checked and i can do that part. but i dont know the code to tell it chkmonday = true then ? what goes next? just for reference. I want to copy C:POSdata to Z:ackupmonday , if monday is checked, and so on.

Any help would be great thanks

New To VB Code.. Need Help With Simple Program
I am trying to write a module for excel, and I can get the following to work.

Function Two_Phase_Pressure_Drop_Qcon_and_Qrad(PipeID, Orient, E, MassVap, MassLiq, RhoVap, _
RhoLiq, VisVap, VisLiq, SurfaceTen, Distance, Pressure)

Do While Distance > 5
If Distance > 5 Then
Two_Phase_Pressure_Drop_Qcon_and_Qrad = twophase(PipeID, Orient, E, MassVap, _
MassLiq, RhoVap, RhoLiq, _
VisVap, VisLiq, SurfaceTen) * (5 / 100)
Distance = Distance - 5
P = P + Two_Phase_Pressure_Drop_Qcon_and_Qrad

Exit Do
End If

Loop Until Distance <= 5

If Distance <= 5 Then

Two_Phase_Pressure_Drop_Qcon_and_Qrad = twophase(PipeID, Orient, E, MassVap, MassLiq, RhoVap, _
RhoLiq, VisVap, VisLiq, SurfaceTen) * (Distance / 100)
P = P + Two_Phase_Pressure_Drop_Qcon_and_Qrad

End If
Two_Phase_Pressure_Drop_Qcon_and_Qrad = P

End Function

But, I need to add some statements that recalculate the VisVap, VisLiq, SurfaceTen, RhoVap, RhoLiq and others with each new pressure drop. I have tried adding the following to the do loop, but I get an error value in excel after this is inserted.

Pressure = Pressure - P
Temp = ((0.000000002 * (Pressure + 14.696) ^ 5 - 0.000001 * (Pressure + 14.696) ^ 4 + 0.0003 * _
(Pressure + 14.696) ^ 3 - 0.0389 * (Pressure + 14.696) _
^ 2 + 3.315 * (Pressure + 14.696) - 69.784) + 459.67) / 1.8
Pressure_psig = Pressure - 14.696
VisVap = VisVap(Temp)
VisLiq = VisLiq(Temp)
RhoVap = RhoVap(Temp, Pressure_psig)
RhoLiq = RhoLiq(Temp)
SurfaceTen = SurfaceTen(Temp)

Simple App/Program Idea... Please Help
I need a really easy application to convert an excel file with 24, 40 position fields into a text document with the same 40 position fields, minus any commas, dollar signs and what not. It must be strictly alphanumeric.

What language would be easiest to do this with? currently in order to get it positioned how I need it I load it into an acccess database, manipulate the data, and convert it to a text file. There has to be an easier way.

Something simple, something where you plug in the excel, hit a button, and it's converted to text.

Any ideas?


Problem With My VERY Simple Program
This program at a first look seems functioning well. All it does is: the user inputs a part number, the program searches for it in the attached excel spreadsheet and fills in the rest of the textboxes from the sheet itself.

When I tried inputting the part 2526, the program did not read any values!

If anyone could take a look at my attachment and suggest what is wrong in my program, that would be the nicest thing ever...this program has driven me mad..



Need Help With A Simple Recursive Program!
It's basically a program where the user enters an input(must be a letter) and the output is: the previous letter's output, the input, the previous letter's output again

input = A output = A
input = B output = ABA
input = C output = ABACABA

here's my code, i'm not exactly sure what's wrong i believe it has something to do with not being a proper recrusive function?

Private Sub cmdCalculate_Click()
Dim a As String
Call jooky(a)
cmdCalculate.Enabled = False

End Sub

Private Sub jooky(ByRef a As String)
a = txtInput.Text
a = UCase$(a)

If (Asc(a) < 65) Or (Asc(a) > 90) Then
picOutput.Print "Sorry you have entered an incorrect input, please enter a letter, A-Z"
ElseIf Asc(a) = 65 Then
picOutput.Print "A"
a = Asc(a)
picOutput.Print Chr(a - 1); Chr(a); Chr(a - 1)

End If

End Sub

Private Sub cmdEnd_Click()
End Sub

Private Sub cmdReset_Click()
txtInput.Text = ""
cmdCalculate.Enabled = True

End Sub

Private Sub txtInput_Change()
txtInput.MaxLength = "1"
End Sub

Looking For Help On Simple Calculator Program
I'm currently working on a project that involves writing a program that will calculate two values depending on what the user enters.
The program first enters what operation he would like to use.
Next First number to be used
Then Second number to be used.

I'm little confused on how to use the IF statement and making it calculate the two numbers using the operation the user enters.
What would be the best way to do this with the program I have written so far?
I'm using VB 5.0 to write the program.

Here is what I have so far.

Dim InputOperation As String
Dim FirstNumnber As Integer
Dim SecondNumnber As Integer

Let InputOperation = ""
Let FirstNumber = 0
Let SecondNumber = 0
Let TextOut = ""

Let InputOperation = InputBox("Please enter opertation to be calculated, such as +,-,*,/")
Let FirstNumber = InputBox("Please enter first number to be calculated")
Let SecondNumber = InputBox("Please enter second number to be calculated")

Simple Program.. Small Help
Private Sub datLocation_Change()
Dim strdatLocation As String
End Sub

Private Sub exit_Click()
Unload Me
End Sub

Private Sub Form_Load()
datLocation.LoadFile ("settings.ini")
Display.LoadFile (datLocation)
End Sub

Private Sub Input_Click()
Dim strLocate As String
Locate = "monkey"
If InStr(Display.Text, Locate) <> 0 Then
Display = InputBox("Enter new file location", "New File")
MsgBox "Unable to locate. No entrie can be made at this time.", vbCritical, "Error"
End If
End Sub

Private Sub load_Click()
Display.LoadFile ("c:monkey.dat"), rtfText
End Sub

Ok thats my code so far.
I want the program to load up the address of the file from the settings.ini file.
But it messes up for some reason. But it was working just a while ago.

I would also like to color code the entires in the file inside the rtb.
What it is:
The start of each line inside the .dat file stats with something spacific.
eg: FFR or DDS
I would like it to color code each line depending on what the line starts with.

And last as u can see from the input code, it wipes the text currently in the rtb.
What i would liek it to do is after it finds the line (like in the code above) to put in what the user enters in the input box after this line.

I have spent most of today trying to get this to work including going throught the general pages and doing tons of searches.

Please help.

Simple Billling Program
Hiya, long time no post.

Here, is one. I need somehelp, adding and editing an access data base. Its simple its a blank data, in which the program will add the records, with the basic social#,Name, Worked hrs, deductionsa and such. PLease help

Simple Program W/ A Function
Though I've been using VB for a few months, I have never used a public function within any of my programs. Of course, I've noticed that more experienced VB programmers use them all the time. I also know that, to add a public function, I'd go to the Tools menu and then select Add Procedure. But I don't really know how to use one well within a program. Can someone please give me an example of a simple program that uses a function?

*Also please tell me how this function is supposed to work within the program - like with a click event, etc...

Simple Program, New User.
Hi guys,

I am sure there is an API for this but looking for some info..
what I want todo is open a regular text file *.txt

A program that lists a dir tree and able to open only text files..

so you double click the file and it open the file target the text file to text box "that's simple."

then have a simple command button on top to search text.
pretty much to find the key word in the doc and take me to in like a find..

Simple Quiz Program
I have been trying to write a quiz containing 10 randomly picked questions, but the question asked never to be asked again. I have pasted the code on to here for some help.I have an idea where it is going wrong but to solve this problem I am a little puzzled.
The problem I get is when the Tempvalue calls for the integer but it is of course a string.
my form has a command button to show the question in a label i.e What is the capital city of England?
And a textbox to input the answer, with an enter key.

Any help will be greatly appreciated...

Private Sub Command4_Click()

End Sub

Private Sub cmdQuestion_Click()

'to perform the one card shuffle

Dim Numberofitems As Integer
Dim Tempvalue As Integer
Dim LoopCounter As Integer
Dim ItemPicked As Integer
Dim Remaining As Integer
Dim YourQuestion As String
Dim Question(10) As String

Question(1) = "Scotland?"
Question(2) = "Wales?"
Question(3) = "Ireland?"
Question(4) = "USA?"
Question(5) = "Italy?"
Question(6) = "Japan?"
Question(7) = "Spain?"
Question(8) = "France?"
Question(9) = "Iraq?"
Question(10) = "England?"

For LoopCounter = 1 To Numberofitems
Question(LoopCounter) = LoopCounter
Next LoopCounter

For Remaining = 10 To 1 Step -1
ItemPicked = Int(Rnd * Remaining) + 1
Tempvalue = Question(Remaining)
Question(Remaining) = Question(ItemPicked)
Question(ItemPicked) = Tempvalue
Next Remaining
QuestionIndex = 1

If QuestionIndex = 1 Then
Select Case Question(QuestionIndex)
Case 1
lblQuestion.Caption = YourQuestion
YourQuestion = Question(QuestionIndex)
Case 2
lblQuestion.Caption = Question(2)
YourQuestion = Question(QuestionIndex)
Case 3
lblQuestion.Caption = Question(3)
YourQuestion = Question(QuestionIndex)
Case 4
lblQuestion.Caption = Question(4)
YourQuestion = Question(QuestionIndex)
Case 5
lblQuestion.Caption = Question(5)
YourQuestion = Question(QuestionIndex)
Case 6
lblQuestion.Caption = Question(6)
YourQuestion = Question(QuestionIndex)
Case 7
lblQuestion.Caption = Question(7)
YourQuestion = Question(QuestionIndex)
Case 8
lblQuestion.Caption = Question(8)
YourQuestion = Question(QuestionIndex)
Case 9
lblQuestion.Caption = Question(9)
YourQuestion = Question(QuestionIndex)
Case 10
lblQuestion.Caption = Question(10)
YourQuestion = Question(QuestionIndex)
End Select

QuestionIndex = QuestionIndex + 1
End If
End Sub

Simple Reminder Program
I have created a reminder program, and was wondering if there is anything more efficent than using a vb timer to kick off the reminder?

In the past I have had issues with timers using up to many resources.

Say if I want the reminder to be displayed in 2 days, I don't really like having a timer run for 48 hours in the sys tray.

Is there a better way than the vb timers?

Thanks for your help.

Simple Login Program
I'm trying to the login program,
i want the user to only be allowed 3 chances of retry(vbretry),the the program sholud exit,
how to i go about is the code
i have 2 text box for txtuser and txtpass and a button.
help is appreciated

Private Sub cmdLogin_Click()

Dim password As String
Dim username As String
Dim attempt, i, retry As Integer

Me.txtuser.Text = username
Me.txtpass.Text = passowrd
username = "admin"
password = "secret"

If username = "admin" And passoword = "secret" Then
MsgBox "Welcome Access Granted", vbOKCancel, "Welcome to Llyods Bank"

retry = MsgBox("Intruder Alert", vbRetryCancel + vbCritical, "Intruder Alert")

If retry = 4 Then
attempt = attempt + 1
Loop Until attempt = 3

End If

End If
End Sub

Private Sub Form_Load()
attempt = 0
End Sub

where to place the loop ...i don't know????

Simple 'print' Program
nevermind. thanks though.

Request For A Simple Program
Well I dont know vb at all, but I have really wanted to make this program and I think it should be simple but I really have no idea, if any of you are familiar with the NCAA Basketball Tournament Brackets, thats basically what this is, 2 sides, split into 4 groups, 32 spots in all. What I want is where you can simulate who will win the event, each round the winner is decided by a 50/50 chance until we get a winner, if anyone could help me make this program, I'd really appreciate it. Thanks

Help Needed With Simple VB6 Program!!
Hi, Ive just started using VB6 and am trying to create a simple booking program for a caravan park. I need to calculate the individual booking cost and the monthly costs for the site. I have done the following code but cant seem to progress. Can anyone shed any light on this? Here is the code I have produced so far.

Private Sub Command1_Click()

Dim Sitebooking As Integer
Dim Clientname As String
Dim Nights As Integer
Dim Accommodation As String
Dim Electricity As String
Dim Sitecaravan As Integer
Dim Sitetent As Integer

Nights = 0

Sitebooking = InputBox("Enter Booking Number") 'read first
Do Until Sitebooking = "999"

Clientname = InputBox("Enter Client Name")

Accommodation = InputBox("Enter Accommodation Type")
If Accommodation = "caravan" Then
Sitecaravan = Sitecaravan + 1
If Accommodation = "tent" Then
Sitetent = Sitetent + 1
Accommodation = ("Please Re-Enter Accommodaton Type")
End If
End If

Electricity = InputBox("Electricity required?")
If Electricity = Y Then
electricitytotal = electricitytotal + 1
electricitytotal = electricitytotal + 0
End If

MyVar1 = InputBox("How many nights?")

Sitebooking = InputBox("Enter Booking Number")


Costs for tents or caravans differ, Electricity is a fixed charge.I cant get the Accommodation section to return the error message and the calculation part is beyond me.

Any help anyone could give would be most appreciated.

I Need A Simple Download Program.
Hi there,

i need an application who can download a setup.exe file from an website, not from ftp, and after download is complete to run the setup.exe.

Can somebody help me with a visual basic code.


Simple Encryption Program
Hi i am trying to right a program that reverses the message which i can do, but i am trying to figure out how to replace a letter with a different letter. Using a chart simular to below:
or some other random replace ment that i specify. I also want to to preserve the case how do i do this.

Simple Program Logic

How can I program my codes to the way when 2 combo Box values (such as custID and CarRegNO) are clicked before a command button is activated for computation?


A Simple Program I Need To Figure Out...
Hello all, I havent touched VB in a while, I have VB 6.0..
Basically all I'm trying to do is, Create code for a program to open up one specific document and search it for multiple words i.e hey hello howdy
I need it to support up to 20 words. Is this possible???

Simple Timer Program
Hello, I'm new to programming VB and using VB6. I trying to write a simple program to create a timing device that runs for 30 seconds, but I want to be able to push the stop button to stop the program from timing any time during the 30 second run if I wish. My form simply has a start and a stop button as well as a text box to display the elapsed time. The problem is when I press start since the system is doing a While Loop I cannot press the stop button.

Here is my code so far:

TM_START = Timer
TM_POS = 0

While TM_POS < 30
TextBox1.Text = TM_POS

I'm sure there is a better way to code this simple program any advice would certainly be appreciated. Thanks again everyone.

Simple VB6 Program Problem
This is a simple VB application that is reading and writing from an Excel file. As of now, I am only working on the writing to Excel part, and am coming across a problem.


Private Sub cmdEnter_Click()

Dim excel_app As Excel.Application
Dim row As Long


' Create the Excel application.
Set excel_app = CreateObject("Excel.Application")

' Open the existing test spreadsheet.
excel_app.Workbooks.Open ("E:BankAccountProjectBankAccounts.xls")

' Insert data into Excel.
With excel_app

If ActiveSheet.UsedRange.Count < 2 Then
row = 1
row = Columns("A:A").Find(What:="", LookAt:=xlWhole).row
End If

.Range("A" & Format$(row)).Select
.ActiveCell.FormulaR1C1 = txtDate
.Range("B" & Format$(row)).Select
.ActiveCell.FormulaR1C1 = txtCheckNum
.Range("C" & Format$(row)).Select
.ActiveCell.FormulaR1C1 = txtDepAmt
.Range("D" & Format$(row)).Select
.ActiveCell.FormulaR1C1 = txtWithdAmt
.Range("E" & Format$(row)).Select
.ActiveCell.FormulaR1C1 = txtBalAfter ' not yet coded
.Range("F" & Format$(row)).Select
.ActiveCell.FormulaR1C1 = txtComment

End With

Dim dateCheckerVal As Boolean
If txtDate.Text = "" Then
dateCheckerVal = False
MsgBox "You must enter a date", vbOKOnly
If vbOK Then excel_app.ActiveWorkbook.Close False 'closes workbook w/o saving
'End If
Set excel_app = Nothing
End If

End Sub

I can run the program and enter the data fine, and it finds the next blank row and enters the data successfully. If I stop the application, run it again, and enter the data again, it works fine again. If I run the program, enter data (it is successful), save the changes when asked by the Excel popup, then enter data again and push the command button again (this is all without stopping the program and then running it again), it gives me error 91 "Object variable or With block variable not set" and points me to the "If ActiveSheet.UsedRange.Count < 2 Then" line near the top.

It apparently has something to do with the "Set excel_app = Nothing" line at the end of the Sub, but I would think that that would not affect it because of "Set excel_app = CreateObject("Excel.Application")" line at the top of the code that should be executed again when I press the command button for the second time.

If anyone could give me any help, I'd appreciate it!

Simple Login Program
I'm trying to the login program,
i want the user to only be allowed 3 chances of retry(vbretry),the the program sholud exit,
how to i go about is the code
i have 2 text box for txtuser and txtpass and a button.
help is appreciated

Private Sub cmdLogin_Click()

Dim password As String
Dim username As String
Dim attempt, i, retry As Integer

Me.txtuser.Text = username
Me.txtpass.Text = passowrd
username = "admin"
password = "secret"

If username = "admin" And passoword = "secret" Then
MsgBox "Welcome Access Granted", vbOKCancel, "Welcome to Llyods Bank"

retry = MsgBox("Intruder Alert", vbRetryCancel + vbCritical, "Intruder Alert")

If retry = 4 Then
attempt = attempt + 1
Loop Until attempt = 3

End If

End If
End Sub

Private Sub Form_Load()
attempt = 0
End Sub

where to place the loop ...i don't know????

EXTREMELY Simple Program
Please help me out, my VB program cannot create EXE from FRM files
Anyway, all i need is a very small window, which has 2 buttons:
"Accelerate" and "Exit"
When someone clicks "Accelerate", the button becomes "Back to Normal". It doesnt have to really accelerate or do anything (it's just for show). When someone clicks exit, it exits the program. The title should be "Surreal WD - Web Accelerator".

Not to worry, this is not going to be a hoax program. I am actually using it to show someone how the buttons change. I know VB Script, but my program just isn't working right.

Thanks a lot.


Copyright 2005-08, All rights reserved