473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Problem with checking if a value entered is equal to one in a DB

Ok this is my first post, gtz me ^^

well i have a DB im making for a project and im using a Vb interface and a access db linking them togethering using ADO.

on one SStab / form i have a drop down box that is populated from a form "orders" in the DB, that works fine.

but when i try and use an IF statement to see if the value entered in a text box is equal to the value in the database it comes up with the same result if its right or wrong, if you get what i meen :D heres some code

Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\cjmillers.mdb"
Data1.RecordSource = "select * from Orders"

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


Private Sub Command24_Click()
'vehical validate
With Data1
.Recordset.MoveFirst
Do Until .Recordset.EOF
If Not (.Recordset.Fields(3) = Text13.Text) Then
Label47.Visible = True
Exit Sub
Else
.Recordset.MoveNext
End If
Loop
End With
End Sub

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

Thanks, hope you can help

P.s im sorry if this is in the wrong place :(
Sep 20 '07 #1
2 1567
Ok this is my first post, gtz me ^^

well i have a DB im making for a project and im using a Vb interface and a access db linking them togethering using ADO.

on one SStab / form i have a drop down box that is populated from a form "orders" in the DB, that works fine.

but when i try and use an IF statement to see if the value entered in a text box is equal to the value in the database it comes up with the same result if its right or wrong, if you get what i meen :D heres some code

Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\cjmillers.mdb"
Data1.RecordSource = "select * from Orders"

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


Private Sub Command24_Click()
'vehical validate
With Data1
.Recordset.MoveFirst
Do Until .Recordset.EOF
If Not (.Recordset.Fields(3) = Text13.Text) Then
Label47.Visible = True
Exit Sub
Else
.Recordset.MoveNext
End If
Loop
End With
End Sub

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

Thanks, hope you can help

P.s im sorry if this is in the wrong place :(
your label is not being set to Label47.Visible = False anywhere. But it does set to .Visible = True. Once true, it will never go invisible based on your IF/END IF handling.

Is this what you are referring to when saying it comes up with same result?
Sep 20 '07 #2
your label is not being set to Label47.Visible = False anywhere. But it does set to .Visible = True. Once true, it will never go invisible based on your IF/END IF handling.

Is this what you are referring to when saying it comes up with same result?

Sorry for th l8 reply ive been concentrating on other parts of my project =)
the label47.visible is set to false when the form loads ( in its properties menu on the right)

i see what u meen about it never going false again i try and sort that out, thx for your help :D
Sep 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Sue | last post by:
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the...
24
by: Apotheosis | last post by:
The problem professor gave us is: Write a program which reads two integer values. If the first is less than the second, print the message "up". If the second is less than the first, print the...
10
by: pjlsr | last post by:
It's close to twenty years since I used the C language and at that time I was doing only floating point computational work, nothing with strings or reading files. I tried to use fopen in the...
4
by: Mr. x | last post by:
Hello, I have declared in my program (*.aspx) something like this : <%@ Page Language="VB" Debug="true" %> .... <% dim current_view_page current_view_page = "1"
7
by: BobRoyAce | last post by:
Let's say I have a text box on a page in which a user is to enter a monetary amount and that I want to ensure that the user enters a value greater than or equal to a certain value that will be...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
1
by: leiger | last post by:
Hi, I need help with this problem as soon as possible (within a couple of days). This is the first time I have ever used Access 2007 and therefore I am having some problems - especially as I...
6
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help with a combo box and this same code works on my first tab with a combo box. The error or problem i have is this code causes an index out of range error when i run it on my second combo...
1
kiemxai
by: kiemxai | last post by:
you see that,i did correct or not? PROBLEM ANALYSIS For an introduction to program transaction journal, see the background section of assignment . Not only transaction journal, but also inventory...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.