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

Data Access Pages Question 1

Status
Not open for further replies.

samusa

Programmer
Jan 1, 2001
107
US
Ok ..I have created Data Access Page based on history table(tblhistory). On Data Access Page I have used Option button (Yes and No)used for student's attendance assessment. When a Supservisor is looking at student information page(Say StudentID 1) and click on No option. Popup window should appear and Supervisor should enter his comments and it should be saved to the same table(tblhistory.Notes) but associated with StudentID1.

If I am using below code without WHERE condition, It is working but is populating all students Notes field with same comment.

Dim varComment, sSQL As String

varComment = InputBox("Please Enter your Comments")

sSQL = "Update tblhistory Set tblhistory.Notes = '" & varComment & "' WHERE StudentID =" & Me.StudentID
MSODSC.Connection.Execute sSQL

StudentID is entered to tblstudent and i have used VBscript with INSERT INTO statement that populates the StudentID field of tblhistory as well.StudentID is selected from dropdown box and his/her information displays rest of the page. Do i have to use kind a recordsetdefs for the above code. Because when I used below code with specific StudentID ,it works fine

Dim varComment, sSQL As String
Dim intStudentID As Integer

intStudentID = 5
varComment = InputBox("Please Enter your Comments")
sSQL = "Update tblhistory Set tblhistory.Notes = '" & varComment & "' WHERE StudentID =" & intStudentID
MSODSC.Connection.Execute sSQL

Please help.......

Sam
 
Maybe I'm making this to simple. You have a Student table with StudentID. When this is created, you should have also populated tblHistory with StudentID. You now have a DAP that shows student data except for attendance assessment. Just create a hyperlink from the first DAP to the DAP created from the tblHistory table that has both StudentID and the memo field on it. When you create the hyperlink, where it says "Filter Criteria for the Data Access Page" type in StudentID = [StudentID]. This will open up the history DAP at the proper StudentID and when they enter their notes, you can have just a regular command button that says SAVE. It will save the notes to the tblhistory for that StudentID. I don't know what you're doing with all that coding. It's not needed.
 
Thanks fneily for your reply. On history table i have several other fields that are bound to DAP(history page).I tried to use server filter but some reason it is not working here although it is working with my other pages.May be I am using Group control on LastName + FirstName and these fields are bound to DAP(Studentinfo page).

Since this is requirement that there should be popup window only when No option is clicked.

In my case i need to find the value of combo box.
Like intStudentID = & DropList1.Value.

Could you please tell me how to get value of selected StudentID from combo.

Thanks

Sam
 
On the first DAP, I guess from what you say, you have a dropdown box to select a StudentID. When a StudentID is selected, it updates the page with the record from tblStudent. Do you also have the FEILD StudentID on the DAP? After all, this is the primary key for the tblStudent. So your filter WILL NOT BE matching the combobox but the StudentID textbox - just like on the other DAP's. Also, are you using the "Filter Criteria for Data Access Page" on the hyperlink dialog box?
Since you're using StudentID as your record key, why are you grouping on LastName and FirstName? I don't understand.
 
Yes on first DAP I have both Dropdown box that updates the rest of the page as well as text box for entering StudentID. When StudentID is entered in tblstudent , it gets simulataneously populated into studentID field of tblhistory as well. I have also dropdown based on tblhistory.StudentID field on DAP2.As Per requirement User should access DAP2 directly and select studentID that updates the page.That is why I did not use server filter between these pages.I have List boxes(grouping) on both pages that displays lastname,firstname and updates the page on selected name.
Now DAP2 apart from other information has option buttons with yes/No option. In case yes is clicked ,Yes is poplulated in field concerned similarly if No is clicked No is populated in field concerned. But as per my requirement if No is clicked it should either open new page or popup window where comments for NO is entered.

Sam
 
Ok. On DAP2, however you get the info for the student, in your case by name which I have problems with, you should show StudentID somewhere on the DAP. If you want to use the onchange event of the option button, then you will have to store StudentID in a cookie and then read it back when the next DAP is opened. REMEMBER, these are not forms, they are web pages so you must transfer data through the Internet Explorer environment. A simpler way, and simple is the way to go to get at least a working system, is to have next to the NO option a hyperlink button to the next DAP with the necessary StudentID = [StudentID] filter so the user can enter their notes. It works, I know it works, and it will work. You can have an instuction label that says "If you select NO, please click button to enter Assessments". You can refine it later. Get something working first.
 
Excellent. Yes this works. Thanks a lot. One more question . How to print date and page no. on DAP reports.

Sam
 
For the date, you can make a textbox on your DAP and in the Control Source on the property sheet type in =Date(). I'm not to sure about a page number. A web page is one page. Explain please.
 
I am generating a DAP report consists of 200 students. Is there a way to put page numbers on it. Before coverting to DAP , report was displaying/printing page number but after conversion, page numeber as well date disappeared.

Sam
 
The date is taken care of. A DAP is a SINGLE web page. So you would have no page numbers. It's one page. When you convert your report, it's all on one web page, correct? If you want 200 web pages, one for each student, that's a different scenario.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top