Solved

form has checkboxes and when adding new record the checkbox is greyed out

Posted on 2004-04-10
10
420 Views
Last Modified: 2007-12-19
form has checkboxes and when adding new record the checkbox is greyed out  the other 198 records are ok and can be checked or unchecked. checked means yes. I thought it was working but when I went to add a new record in the form all my yes/no checkboxex were greyed out..Thanks for any info.

Richard(racer53)
0
Comment
Question by:racer53
  • 7
  • 3
10 Comments
 
LVL 27

Expert Comment

by:jjafferr
ID: 10798075
Hi Richard,

This sounds like your Check box is not Bound to a Table, if UnBound, then 1 change, changes all.

Hope this helps

jaffer
0
 

Author Comment

by:racer53
ID: 10801411
thanks Jaffer for the tip but I double checked the contol properties and all are bound.
Very strange. even if I go to the table and click to new record 199 then go to one of the checkboxes and click it the data base goes back to record 167.
When I made the yes/no the default lookup is checkbox.and if I go to any of the 198 records I can enter a check in any of the boxes and it works even in the form. but try and do a new record and all the yes/no checkboxes and yes/no comboboxes get greyed out so you can not use them.
It is more then likely something I have overlooked . I suppose I could use a drop list with the yes no choices..

Richard
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 10801778
Richard
why don't you zip your mdb and email it to me, let me have a look at it.
click on my name to see my profile and my email.

jaffer
0
 

Author Comment

by:racer53
ID: 10806001
jjafferr

I believe the issue is too many controls. I have many checkboxes . If I make the form linked or subform it works. I ran performance and that was it concerns too many control .

Thanks for the help

Richard
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 10806072
It makes no difference
if properly controlled to a table, then it should work.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 27

Accepted Solution

by:
jjafferr earned 20 total points
ID: 10811045
Richard

I have looked in your mdb, and here are my comments:
1-
Your Form is NOT bound to a Table, its Data Source is from an SQL, which is fine in alot of cases, but not in your case, because your SQL is for 3 tables (continue next points).
2-
The Records are NOT saved in the Table, thus your check boxes are UNBOUND until a Record is saved in the Table.
3-
After you enter all the data, when you press on Save Record button, at this stage the Records ARE created in the Tables, thus it enables you to press on the Check option field (although it is still gray).
4-
to make the Check option fields normal, go to VB edit of the Save Record button, make it look like this:

    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Me.FIRST_RESPONSE = 0

----End of Solution------
Recommendation:
Make your Member04 Form as the Main Form, and insert Training Record as a SubForm (because Training Record is a sub Table of member04 Table), so once you enter the data in the member04, a record gets created/saved in Training Record Table too, and your check option is clear.

I am sending you back your mdb with the following:
- The save button in your membership Form is modified as stated above.
- A new Form called frmMember04 is created based on my recommendation.

good luck.

jaffer
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 10813470
Thanks for the points and the grade Richard,
I wonder which one did you choose?
The easy way,
OR
the hard way?

jaffer
0
 

Author Comment

by:racer53
ID: 10813506
Jaffer

I am not sure if I fully understand the bound and Unbound. But I will study it some more and do and redo the database from start to finish to help me learn.
The form parts from the training would only work when the new record was saved (but still grey out) but worked correct? dosent matter I prefer the subform method.
Your example is the original way I was doing it but I had very difficult time getting the setup and look that you have so I went the otherway. Just yesterday I went back to trying the subform just as you recommended. It certainly did not look like yours. When you make your forms you do not use the wizard I bet.

Thanks again I am looking foward to analizing your database with the recommendations the VB code is not needed for the save button when using the subform I assume but would not hurt
Thanks again

Richard
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 10813744
what I meant by Bound and UnBound:
If the Record exists in the Table, then Check boxes are Bound, thus can be ticked, However,
in your case, since the Records IS NOT saved yet in the Table, thats when you cannot use the check boxes, but,
once the Record is saved, then only these check boxes are located in the Table, thus can be ticked.

OK, another easier solution:
Lets keep your favorate Form as is (I you spent alot of time fine tunning it till you got where you are ;o) ),
Move Member's Current Status up before the Check boxes (it is required to save the Records),
Place the following in your VB:

Private Sub lblmemstand_LostFocus()
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Me.FIRST_RESPONSE = 0
End Sub

Thats it, your Form and the Check Boes will work once you fill this field and press on the TAB key.

Explaination:
1- Your Record in the 3 Tables have to be saved before you can use the Check boxes, and it requires lblmemstand field.
2- Once you press TAB, through VB, we issue the Save Record comman, then
3- We issue the [FIRST RESPONSE]=0 which means [FIRST RESPONSE] is UnChecked.

If you need help in doing what I told you here, then please do it within 30 minutes, otherwise,
IT'S PLAY TIME.

jaffer
0
 
LVL 27

Expert Comment

by:jjafferr
ID: 10813839
Richard
I have emailed you what's so called, version 2 (LOL, couldn't come with a better name),
it has the latest comment I posted above,
AND
A newer look for my suggested Form.

What I did is basically took out the border of the SubForm, so it looks like it is part of the main Form.

check it out.

jaffer
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now