Tech Support Guy banner
Status
Not open for further replies.
1 - 16 of 16 Posts

·
Registered
Joined
·
356 Posts
Discussion Starter · #1 ·
Need code help in access

In laymans terms I need to do something like this for multiple comments:


Private Sub Form_Load()
If MGR_Comments is not null (or is populated) Then LabelMgr will = visable
And IF ENG_Comments is not null (or is populated) Then LabelEng will = visable
And If ENV_Comments is not null (or is populated) Then LabelEnv will = visable
End If
End Sub

This is for indicating if comments have been made on a summary form, the label will become visable and say "Manager" for example. I have the labels property for "Visable" set to "No". I don't know if this is the right way to do this or not???

Thanks, Joe
 

·
Banned
Joined
·
1,098 Posts
Assuming these are separate labels that don't overlap then it should work if you remove the And.

If MGR_Comments is not null then LabelMgr.Visible=True
If ENG_Comments is not null then LabelEng.Visible=True

If these are separate labels that overlap then you need to decide how you'll handle it when there's more than one comment. Assuming you'll display them in order (i.e. if manager comment then you'll show that, otherwise you'll show engineer comment) then you'd code it with either Else or maybe using a Select Case. Select Case executes the *first* case that's satisified, not every case that's satisfied so it would work, but I don't personally think it's as clear as the If/Else when multiple tests are met.

If MGR_Comments is not null then LabelMgr.Visible = True
Else If Eng_Comments is not null then LabelEng.Visible = True
End If
 

·
Registered
Joined
·
356 Posts
Discussion Starter · #5 ·
Hey OBP I am struggling with this:

In frmNNFList there is a line that starts "Comments Made By:" I want the labels to appaer only when the frmNewNonFunded comments sections are populated. I kinda have it working but it is not being applied properly to each record set??

It might be a simple fix but I don't get it.
Thanks, Joe
 

Attachments

·
Registered
Joined
·
19,896 Posts
Joe, I have added & tested the code for the Managers Comment. However the fields do not appear until afetr you have entered the data and moved to the next field, which means that you have to go back to the sign field, so \I have added a set focus to the code as well.
 

Attachments

·
Registered
Joined
·
356 Posts
Discussion Starter · #7 ·
Hey OBP, this is a great feature and I will use it, however when the comment is populated I want it to make visable the "Manager" label (for instance) on the frnNNFList because this will be a summary form of all the records so that management can quickly and easily see that a comment has been made by a manager, engineer, etc. The code I have for it "OnLoad" sort of works but is not applying it individually per record. For instance one record might have 2 labels visable, another 4 labels visable depending on how many comments have been entered per record.

Also this feature you have made to make the other fields visable on the frmNewNonFunded I will need them to self populate with the "Environ" and the current date.

I hope I have explained this well??

Thanks, Joe
 

·
Registered
Joined
·
356 Posts
Discussion Starter · #8 ·
I think that what I am trying to do is not possible because the "comment by" labels on frmNNFList are not bound to any specific record-is that correct???
 

·
Registered
Joined
·
19,896 Posts
The Me.LabelEnv.Visible and Me.LabelPC.Visible are working on the version that you sent me.
But the code should be in the On Current event to be refrshed for each record.
 

·
Registered
Joined
·
356 Posts
Discussion Starter · #11 ·
I moved it to "On Current" but it is still not working properly it is only picking up data from record #1.
If you look at record 2 it has 5 comments, record 3 has 1 comment. Record 1 has 3 comments in Manager, Environmental, and Prod Controller and those 3 are the visable labels in frmNNFList.

Is it because those labels in frmNNFList are not bound to the records? Maybe I can instead add the comment field with label to the frmNNFList, hide the text box and just use the label associated with that control??
 

·
Registered
Joined
·
356 Posts
Discussion Starter · #12 ·
I just made a new record #4 and now the only visable label on frmNNFList is is showing on all 4 records for for record 4

I think I am in over my head!
 

·
Registered
Joined
·
356 Posts
Discussion Starter · #13 ·
I think I need to back up and start over with this;
Is there a simple way to indicate on frmNNFList that a comment has been made in the 5 comment catgories without actually showing the comment? What I have been trying has failed and if I can get a label to =visable it is global instead of applying to each record individually.

This form is a summary of all the records and I just want a quick way to see if a comment has been made and by what department for each record.
 

·
Registered
Joined
·
356 Posts
Discussion Starter · #15 ·
Hey OBP, here is what I came up with and it seems to be working OK. One thing that I don't know how to do is link 2 forms, maybe you can show me?

On frmNNFList I want to be able to click on the WONUM field and open frmNewNonFunded so that it opens the corresponding record.

I am working on my 2010 microsoft at home but I think it still saved it in 2002-2003 format

Thanks, Joe
 

Attachments

1 - 16 of 16 Posts
Status
Not open for further replies.
Top