Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to retrieve data in checkbox format from Access

Status
Not open for further replies.

bearfish

Programmer
Nov 10, 2003
28
MY
Hi,
My database using Microsoft Access set the field A as data type Yes/No. When I try to retrieve the data back to my VB screen to got this error "Run-time error '380': Invalid property value "

The code below is how i retrieve the value A. Anyone know why? ANything miss out?

moCommand.CommandType = adCmdText
moCommand.ActiveConnection = moConnection
moCommand.CommandText = _
"SELECT A FROM TABLE WHERE TABLEID = " & sInputDat & " ;"

Set rsMain = moCommand.Execute

Me.chkA = rsMain!A
 
Maybe this will do the trick

if rsMain!A = "yes" then
chkA.Value = 1
end if

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
The trick doesnt work. Though no error, but can't show it on the VB form. It doesnt checked on the form when in DB its Yes, means its checked.
 
I got it work. Thanks alot for your suggestion.
 
Comm'n man, show a little willingness and enthusiasm, I'm sure you could have figured out the mistake just as easily as I have?

Maybe this will do the trick

if rsMain!A = "True" then
chkA.Value = 1
end if

**********************************
May the Code Be With You...
----------
x50-8 (X Fifty Eigt)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top