English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I've been using VB for not so long and I am making a basic username and password test for a program I am going to make in the future, but I can't quite get the coding to work.

Look this is how my interface looks like:

http://i14.tinypic.com/497tg02.jpg & http://i14.tinypic.com/486ehxz.jpg

This is my code:

http://i14.tinypic.com/49iyqrq.jpg

And this is what happens when I click Login:

http://i13.tinypic.com/2vhx5qp.jpg

While what I want to happen is the yellow bar goes green and says Hello.

Please help me. Thanks in advance.

2006-10-26 08:29:21 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

I put the if statement in front, but then this error message came up:

http://i13.tinypic.com/34fi7nk.jpg

What am I doing wrong, please could someone explain in more detail and in simpler terms.

Thanks so much.

2006-10-26 09:12:23 · update #1

Thanks idefix for the help. I have entered your code but unfortunatelly it still doesn't work, I think its getting closer and it is almost working this is what happens:

http://i13.tinypic.com/2nhmicp.jpg

Any more help will be appreciated :-)

2006-10-26 10:14:34 · update #2

My email is digested_cat89@yahoo.com or just post here.

Thanks again.

2006-10-26 10:20:34 · update #3

3 answers

You are missing the "If" command at the beginning of your subroutine.
Start like this: If textusername.value etc.

Also I notice a lot of subroutines you started but did not complete, remove them as they only clutter your code and slow down the execution.

2006-10-26 08:52:40 · answer #1 · answered by argeesoftware 3 · 0 0

1. "IF" command always starts with "IF" and finishes with "END IF"
2. A user form needs to be updated to show the modification such as "Hello" and a green bar
(Note the code Me is used to avoid repeating the name of a user form. In your case Me = UserForm1

Herewith is what your code should be

Private sub cmdlogin_click()
IF txtusername.Value="texas1" AND txtpassword.Value="Kitty" Then

With Me.Label1
.Caption = "Hello"
.BackColor = &HFF00&
End With

Else

With Me.Label1
.Caption = "Goodbye"
.BackColor = &HFF&
End With

End If
Me.Repaint 'update userform1
End Sub

2006-10-26 09:36:18 · answer #2 · answered by Anonymous · 0 0

we additionally make project in VB, it is likewise our project yet our instructor informed as that we could deactivate the settings of the VB and set as default. it quite is kinda complicated to locate the placing decision in simple terms locate it. it been 3 years as quickly as we use the VB. i cant bear in recommendations something of it. im from phil.

2016-10-16 10:45:04 · answer #3 · answered by ? 4 · 0 0

fedest.com, questions and answers