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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing Checkbox value in db

Status
Not open for further replies.

acorbally

Programmer
Jan 9, 2001
65
US
I have a screen which has a button that pops up a second screen for entry. In the second screen you enter dates, names and check some checkboxes and then press save. Save returns to the previous calling function and continutes to process in the original screen. My problem is that in the second screen everything is being stored in the database except the check box values. What is going on? When I press save "return" is called and if I debug, I see it change from .T. to .F.. What am I doing wrong?
 
Are you binding the checkboxes to the table fields? (ie. is the ControlSource table.field?) Are the table fields logical? Do they support .Null. values? Do you initialize the checkboxes to a logical value?

Rick
 
I guess to better explain myself here is what I am doing. First I intitialize the checkbox values each to .F. There are database fields for each of the check boxes. They are of type logical. The variable name in the check box properties window are named the same as the table field names, however they are not table.fieldname. What do you mean do they support null falues?
 
If you don't use a table field name or a form property (or <cringe> a Global variable), the variable value has no scope and can't be accessed from anywhere!

Any VFP table field can be defined to support a NULL value. Any table that defines even a single field that accepts NULL will only have a maximum of 254 fields - rather than 255. (The last field is used to store a "flag" indicating the field is NULL.)

Rick
 
Rick,
I believe you got confused with the forums.

acorbally,
Are you initializing those memory variable prior to calling the function? If not - if you are initializing them within the local function, they lose any changed value when you return from it.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Dave,
You are right, yesterday the order of my forums list changed (still nor sure why), and I was obviously convinced I was in the VFP forum. [blush]

acorbally,
I apologize - I was really answering for a whole different version of FoxPro, and while technically I was "in the ballpark", Dave's question / answer is what I should have provided!

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top