|
-
Mar 27th, 2000, 11:38 PM
#1
Thread Starter
Addicted Member
I need to get the case to be pulled up from what the user inputs in an input box and then query the database with that information. I cannot get it to work. I am using an msflexgrid so all cases will appear for the same person. people can be in the database by their case number more than once -- but each complaint has its own autonumber. If you follow. So the same case number say 000000 could be in the database 10 times and I want all of those to show up in the grid, but the "000000" needs to be a variable for the query!!
here is my code i am getting a syntax error:
Private Sub Form_Load()
GetAuto$ = InputBox("Enter Case No", "PSR Input Data")
Data2.RecordSource = "SELECT * FROM MASTER WHERE CASE_NO LIKE '" & GetAuto$ & "" ' ""
End Sub
-
Mar 28th, 2000, 02:16 AM
#2
Frenzied Member
Is case_no text or numeric?
Do you want to get an exact match or can the user enter a partial case_no?
-
Mar 28th, 2000, 06:09 AM
#3
Thread Starter
Addicted Member
well it would be an exact match
thanks
-
Mar 28th, 2000, 07:16 AM
#4
Frenzied Member
An exact match for Char text would be
Data2.RecordSource = "SELECT * FROM MASTER WHERE CASE_NO = '" & GetAuto$ & "'"
An exact match for a numeric field would be
Data2.RecordSource = "SELECT * FROM MASTER WHERE CASE_NO =" & clng(GetAuto$)
The database field CASE_NO will drive which format you use.
[Edited by JHausmann on 03-28-2000 at 07:17 PM]
-
Mar 28th, 2000, 10:25 PM
#5
Thread Starter
Addicted Member
The numeric field would have to be defined in the access database as such
because I gave it a text property in the database even though it is always numbers; what would be the benefit of changing it to numeric? How does it help -- with the integrity or are there other good reasons
Help a lamer is in the house!!!
-
Mar 28th, 2000, 11:36 PM
#6
Lively Member
Numerics
Bebe,
How are you using the data in the numeric field. If you are doing any math against the field then you would probably want it numeric. If it is a display type only field then it isn't as important (although if it is always going to be numeric I would make it numeric because it makes it easier to query against it). :P
If it was text then "0003", "003" and "3" would be different where a numeric value would be identical (3).
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
|