Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-04-10
10
Medium Priority
?
427 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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