|
-
Jul 19th, 2008, 10:38 AM
#1
Thread Starter
Fanatic Member
-
Jul 19th, 2008, 11:10 AM
#2
Fanatic Member
Re: 3 problems...Can anyone help me?
go to components and click microsoft forms 2.0 object library and use a button from there for the first problem
-
Jul 19th, 2008, 11:13 AM
#3
Re: 3 problems...Can anyone help me?
 Originally Posted by louvelle
My first problem is about a command button for browsing an image.
I don't know how to make a command button that when you click the button, it will just browse.
Go to Components (ctrl+T) and add Microsoft Common Dialog control.
Then add Picturebox and command button, copy/paste and run sample code below:
Code:
Private Sub Command1_Click()
With CommonDialog1
.FileName = ""
.InitDir = "c:\"
.Filter = "All Pictures (*.bmp;*.jpg;*.gif;*.ico)|*.bmp;*.jpg;*.gif;*.ico"
.ShowOpen
If Not .FileName = "" Then
Set Picture1.Picture = LoadPicture(.FileName)
End If
End With
End Sub
-
Jul 19th, 2008, 11:18 AM
#4
Thread Starter
Fanatic Member
Re: 3 problems...Can anyone help me?
I don't have a visualbasic at home but if I use the code, will it browse and place the image that I selected to the Image box?
Sorry, just a new at vb6...
-
Jul 19th, 2008, 02:10 PM
#5
Re: 3 problems...Can anyone help me?
That is precisely what the code does.
-
Jul 19th, 2008, 02:16 PM
#6
Thread Starter
Fanatic Member
Re: 3 problems...Can anyone help me?
Ahh.. I see.. Got any ideas on my second problem?
-
Jul 19th, 2008, 02:22 PM
#7
Re: 3 problems...Can anyone help me?
Your 2nd and 3rd question are database related - I suggest you read some topics in our DB FAQ forum first.
Also, you need to specify what type of database you use.
-
Jul 19th, 2008, 02:29 PM
#8
Thread Starter
Fanatic Member
Re: 3 problems...Can anyone help me?
I'm just using the data control...
-
Jul 19th, 2008, 02:38 PM
#9
Re: 3 problems...Can anyone help me?
Data control is something that helps you connect to your database and also manipulate your data.
However, you must have DATABASE first - MS Access, MS SQL, Oracle, MySql, etc, etc, etc...
Since you are completely new to working with databases I recommend you visit our Databse FAQ forum first.
Without educating yourself on the the topic you won't get anywhere further than where you are now.
Good luck.
-
Jul 19th, 2008, 02:53 PM
#10
Thread Starter
Fanatic Member
Re: 3 problems...Can anyone help me?
I've found my answer to my 3rd problem. Thanks.
But I couldn't find anything about my 2nd problem..
I'm using MS Access for my database...
-
Jul 20th, 2008, 12:09 AM
#11
Re: 3 problems...Can anyone help me?
I believe, you are having a form for entering student details ("StudentID form"). And it contains two text boxes named txtName and txtLastName, for entering first name and last name respectively. And a command button named cmdSave for saving the data into the database. Then you can use the following code for checking the the last name and first name..
Code:
Private Sub cmdSave_Click()
If Trim(LCase(txtFirstName.Text)) = Trim(LCase(txtLastName.Text)) Then
MsgBox "Both last name and first name are same..! Please change it..!", vbCritical, "Same..!"
txtLastName.SetFocus
Exit Sub
Else
'code for saving the data into the database
End If
End Sub
Please keep in mind that, this code is for checking duplicates when you are adding a new data using the StudentID form and it will not check for any duplicates that has been already entered in the database.....
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jul 20th, 2008, 10:37 PM
#12
Thread Starter
Fanatic Member
Re: 3 problems...Can anyone help me?
It's ok. I'll just input a code so that the data won't save... Thank you guys!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|