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

Blank Fields Greyed out

Status
Not open for further replies.

aaabuhalime

Instructor
Nov 22, 2012
67
US
Hi,
I have a form created from a query, the form displays Information about Teachers, Principles and Students, I have a combobox that holds the values (Teachers, Students, Principles), When the Teacher is selected from the combo box all the teachers related info displayed and , the Not realted teacher information, or tha fields that doeasnt apply to the teahcer remains blank, same thing applies to students and principles case, my question is their a way to get those filds greyed out, for eample when I select teacher all the non applicable (fields blank) get greyed out, and when I sellect student all the blank fields that don't apply to students get greyed out and so on .......Any help on how to do that will appreciated.

Thanks
 
Hi and thank you very much for your help,I have another question please,I have a form created from a query, the form displays Information about Teachers, Principles and Students, I have a combobox that holds the values (Teachers, Students, Principles), When the Teacher is selected from the combo box all the teachers related info displayed and , the Not realted teacher information, or tha fields that doeasnt apply to the teacher remains blank, same thing applies to students and principles case, my question is their a way to get those filds greyed out, for example when I select/enter the teacher info all the non applicable (fields blank) get greyed out, and when I select/enter students info all the blank fields that don't apply to students get greyed out and so on .......Any help on how to do that will appreciated.

Thanks
 
How are ya aaabuhalime . . .

See thread702-1699097

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
TheAceMan1,
I was going to suggest the same thread.
The combo box must have at least one column (could be width of 0) that identifies the selection of a teacher, principal, or student.

Duane
Hook'D on Access
MS Access MVP
 
Howdy dhookom . . .

Roger That! ...

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Good thank yall for your help, definitely I will try this, but I have an other issue here I am using Access 2010, I just opened the database ( the version on my desktop)and double clicked on one of the records which supposed to take me to to an other form, I have a msg displayed says Access stopped working, I restarted my pc, and and the db, but when i click on the record nothing happens? Any thoughts on how this can be fixed please, I do really appreciate you help and support.
 
I have a list of records (ID, FirstName, LastName) when I double click on any name, an other form is opens including the information matching that ID/Name. since I had this error, when I click on the name nothing happens. sorry for not explaining well.
 
To aaabuhalime . . .
aaabuhalime said:
[blue]I am using Access 2010, I just opened the database ( the version on my desktop)and [purple]double clicked on one of the records which supposed to take me to to an other form[/purple], I have a msg displayed says [red]Access stopped working[/red] ...[/blue]
You need to describe double-clicking on a record ... did you double-click a [purple]field[/purple] ... the [purple]record selector[/purple] ... what?

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
double click on record selector, for example each record includes the following (ID, FName, LName),I have list of records when I double click on any record any where on the name,or Id all treated as one record, it opens another form including the information matching that ID/Name. since I had this error, when I click on the name nothing happens. sorry for not explaining well.
 
yes, I had the double click working fine, but it it stopped after I got the msg "MS Access stopped working", I need any though of how this can be solved.
 
aaabuhalime . . .

We need to see the code in the [blue]On Dbl Click[/blue] event.

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thak you very much yall, I fixed the problem, I decompliled my db, and it is working fine.

Thanks
 
Hi All,
Thank you very much for all your help, now let jump back to my original question, now I have a combo box that hold (Students,Teachers, Principles) I have bunch of other comboboxes, (Combobox1,combobox2.....), so when I select Teacher i want all comboboxes to show on the form except for example combobox1, and combobox2 and soon, this applies to students and principles, I checked the link you provided, but let me clarify to make sure I am on the right path now, TheAceMan1 suggested to put something in the Tag property of each combo box that would identify if it is enabled based on the value of the option group can you explain more based on my case? and also Then, the following code goes under the original combobox. Right? and then for each combobox I want to see on the form when the Teacher is selected I have to put ,Tin the Tag property, right? please correct me if I am wrong.
Dim ltr As String, ctl As Control

ltr = Choose(Me.Schoolemembers, "T", "S", "P")

For Each ctl In Me.Controls
If ctl.Tag <> "" Then
If InStr(ctl.Tag, ltr) > 0 Then
ctl.Visible = True
Else
ctl.Visible = False
End If
End If
Next
 
aaabuhalime,
Learn how to use TGLM to format you code in posts. It is much easier to read. This code would need to be run whenever the value of Schoolemembers changes.

Code:
  Dim ltr as String
  Dim ctl as Control
  [COLOR=#4E9A06]'assuming Me.Schoolemembers is a numeric value and the control is spelled correctly[/color]
  ltr = Choose(Me.Schoolemembers, "T", "S", "P")

  For Each ctl In Me.Controls
    If ctl.Tag & "" <> "" Then
        ctl.Visible = (InStr(ctl.Tag, ltr) > 0)
    End If
  Next

Duane
Hook'D on Access
MS Access MVP
 
I will try this, I will keep you posted, another question what will change if the Schoolmembers is text value not a numeric?
 
And, why would you not provide information about the possible values of Schoolmembers? If it is the actual text values then maybe you can use Left(Me.SchoolMembers,1). But, we should not have to guess, you should volunteer this significant information in your first post.

Duane
Hook'D on Access
MS Access MVP
 
aaabuhalime said:
I have a combo box that hold ([blue]Students[/blue], [blue]Teachers[/blue], [blue]Principles[/blue])

Then ltr becomes:
Code:
[blue]   ltr = Left(Me.Schoolmembers,1)[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top