Solved

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

Posted on 2004-04-10
10
423 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

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
 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

820 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