A little help please. Sample Included

xxdcmast
04-13-2004, 07:56 AM
Im kinda stuck as to what to do here. Basically what I am trying to do is use the program below in conjunction with an access database to retrieve file information. The way it should work is to match up a persons account number and pin number and then return their account details. The variables for X and Y are the values of account and pin that would be used in the select statement for the sql but for some reason It doesnt seem like it wants to work correctly????????

Ales Zigon
04-13-2004, 09:40 AM
Redim your x as long instead of integer

xxdcmast
04-13-2004, 10:10 AM
Redim your x as long instead of integer
Its not really that I cant get the select statement to actually display any text

Ales Zigon
04-13-2004, 10:34 AM
What select statement? If you mean this:
Private Sub Check()

Find = _
"SELECT Balance FROM Customers"
Bal
End Sub


it won't do much as you're not loading your other form - frmDatabase (I guess this is the one you want) and the "bal" sub in that form is private, so you can't call it from there. I'd suspect, you'd want to didsplay the database content, so I'd replace the code above with this code:
Private Sub Check()

Load frmDatabase
frmDatabase.Show

End Sub


And if you want only to show the onformation for the particular customer, the SQl statement should look something like thos
"SELECT Balance FROM Customers WHERE PIN =" & y & " AND Account =" & x & ";"

You should run this query before you show your information form (either load the form, and set the recordcsource of your ADODC to this SQL (remember to change command type to adCmdText!!) and the show the form, or myke your x and y variables global and build this SQl in the load event of the frmDatabase)

xxdcmast
04-13-2004, 10:57 AM
Thats exactly what I was trying to do because the program is suppposed to simulate an atm and it cant be showing other peoples account information. And now with that sql statement i should be able to put a check in for it to display no record found if it returns a null value right?

Ales Zigon
04-14-2004, 12:06 PM
Yup

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum