Actually, I think I fixed that issue now. Now I'm going to create a procedure for the frmContract form. I will post the entire lab later on tonight so you can review it so hopefully you could respond back to me tonight.
Actually, I think I fixed that issue now. Now I'm going to create a procedure for the frmContract form. I will post the entire lab later on tonight so you can review it so hopefully you could respond back to me tonight.
Ok, for the frmContract form, I got stuck and I know the code is incorrect but here is what I got:
Option Compare Database
Private Sub Form_Current()
'For older contracts, display a message and the LessonType field value in bold, blue text
'For all other contracts, display the LessonType field value in black without a message
If LessonType = #Value# Then
lblNoInstr.Visible = True
LessonType.ForeColor =
Else
lblNoInstr.Visible = False
LessonType.ForeColor =
End If
End Sub
So what will be the correct way to write this procedure out? If you need reference, here is the link to the assignment I'm working on again, its Case Problem 1 page 606
http://books.google.com/books?id=udW...onvert&f=false
Code:If LessonType = "Voice" Then lblNoInstr.Visible = True LessonType.ForeColor = vbBlue LessonType.FontBold = True Else lblNoInstr.Visible = False LessonType.ForeColor = vbBlack LessonType.FontBold = False End If
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ok here is the final version of Lab 11, can you check it to see if everything is correct? Thanks and hope to hear from you shortly. Here is the lab below:
I prefer you to analyze your work and identify specific issue.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Well for the frmContract, I see the No Instrument text next to the LessonType box and the text is blue and bold. However, I could enter anything in the LessonType box and it always comes out blue and bold and the No Instrument message doesn't disappear when its needed. That is the problem I'm having.
The code is in the form Current event and only executes when navigating records.
If you want the code to execute when enter value into LessonType textbox then also need it in the textbox AfterUpdate event.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Oh man, I entered the code into the AfterUpdate textbox, but any text I enter into the LessonType box is just regular black font. I got ridof the code in the form Current, but nothing is improving. That's odd. Why is it still not working then?
Okay, I got it to work now for the LessonType box. Now I will work on Lab 12.
Ok in this lab I need to create a query named qryInstrumentSubquery that contains the following fields, iin order, frm the tblContract table: LessonType, StudentID, ContractStartDate, ContractEndDate, and MonthlyRentalCost. So for this part, do I just make it a Simple Query? If I did that, I would not get the option box to allow me to sort in ascending order, so that is why I was wondering what kind of query do I use to create this. Later on it says to select only those records with a MonthlyRentalCost value not equal to zero (I don't know how to do that, do I go to the Properties sheet to figure that out)? Then it says to switch to SQL view, add a subquery to the existing query that selects all students who play the guitar, run the query, and then save and close the query. Basically I need help with all of this haha, so if anyone could help me out I would really appreciate it. Here is the lab I'm working on Case 1 http://books.google.com/books?id=udW...bquery&f=false
I'll post the lab below:
Hey June7, if you could drop by and help me with my questions I would really appreciate it. Thanks and hope to hear form you soon.
I didn't say to eliminate code from Current event. You really need it in both events.
What do you mean by 'would not get the option box'? What 'option box' are you referring to?
You should review tutorials or Access Help on building simple select queries - very basic Access functionality. SELECT queries can have sort and filter criteria. Filter criteria under MonthlyRentalCost would be <>0. Apply ASCEN sort order under whatever field is appropriate.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ok I created the query, but what will be the right subquery code to add to the existing query that selects all students who play the guitar? Here is the lab below:
Why are you confused about building simple select queries with multiple criteria?
Post the sql statement you attempted if you have an issue with it. Does it show the records you expect?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Here is the code I have, SELECT tblContract.LessonType, tblContract.StudentID, tblContract.ContractStartDate, tblContract.ContractEndDate, tblContract.MonthlyRentalCostFROM tblContract
WHERE (((tblContract.MonthlyRentalCost)<>0))
AND LessonType IN
(SELECT LessonType
FROM tblContract
ORDER BY tblContract.LessonType, tblContract.ContractStartDate);