Updateable checkbox

H

Hitesh Joshi

Hi,

I have a simple form in front end Access 2003 and a table in back end
SQL 2k.

I have a col datatype bit in SQL table. When I try to display this
using checkbox on my form, I cannot update the data, i.e. doesn't
allow me to check or uncheck this box.
This is over ODBC. Any hints?

hj
 
H

Hitesh Joshi

I think know what is going on... I need to figoure out how I can make
the form updatable.

Right now I cannot do dataentry of any kinds.

hj
 
D

Douglas J. Steele

Do you have a primary key defined for the table in SQL Server?

ODBC renders all connections as read-only if there's no unique index.
 
H

Hitesh Joshi

Yes there is a PK.

hj

Do you have a primary key defined for the table in SQL Server?

ODBC renders all connections as read-only if there's no unique index.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)









- Show quoted text -
 
H

Hitesh Joshi

figured out.. doesn't make sense but I was pulling the data from a
query and table at the SQL backend had FK but somehow I could not do
the update... so now I am pulling the data directly from the table.

thanks,
hj
 
H

Hitesh Joshi

This is something interesting I want to try...

I have this checkbox field 9which is working on my form) based on that
checkbox, if that is checked then next field Branch should be
'disbaled' (or dimmed)
I guess have to learn vba
hj
 
H

Hitesh Joshi

here is the code I have but it does not work:

Private Sub BranchID_BeforeUpdate(Cancel As Integer)
If All_Branches.Value = 1 Then
BranchID.Enabled = False
Else
BranchID.Enabled = True
End Sub

hj
 
G

Guest

If you want to disable a text box based on whether a check box is checked or
not, you need to put the code in two places, the form's Current event and the
After Update event of the check box.

Me.Branch.Enabled = Not Me.Check9
 
G

Guest

Two problems. It is in the wrong event. It should be the After Upate. and a
check box will never = 1. It will be either -1 (True/Checked) or 0
(False/Not Checked)
 
H

Hitesh Joshi

Two problems. It is in the wrong event. It should be the After Upate. and a
check box will never = 1. It will be either -1 (True/Checked) or 0
(False/Not Checked)

Thank you, That worked.

hj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top