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!

I am having a problem creating a calendar

Status
Not open for further replies.

trc

MIS
Nov 27, 2000
126
CA
I am having a problem creating a calendar that print out appointments for people at my company. I have the calendar working but I can't print out the data. I created functions to do it but they do not work right. There are two problems: (1) the PrintData function prints the data at the top of the page and at the bottom but not where it was called form. (2) the way I built the link does not work correctly. Grrr.

Function GetData()
Dim recCount,strData
Recordset1.MoveFirst
strData = ""
recCount = Recordset1_total
'recCount = Recordset1.RecordCount
redim arrayData(recCount)
redim arrayDate(recCount)
'Recordset1.movefirst
for intCount = 1 to recCount
arrayDate(intCount) = Recordset1.Fields.Item("Date").Value
strData = &quot;<a href=&quot;&quot;/more_details.asp?id=&quot; & (Recordset1.Fields.Item(&quot;ID&quot;).Value)& &quot;>&quot; & (Recordset1.Fields.Item(&quot;Person&quot;).Value)& &quot;</a>&quot;
'<!--&quot;<A HREF=&quot;&quot;more_details.asp?ID=&quot; & Recordset1.Fields.Item(&quot;ID&quot;).Value & &quot;>&quot; & Recordset1.Fields.Item(&quot;Person&quot;).Value & &quot;</a>&quot;-->
arrayData(intCount) = strData
next
End Function

Function PrintData(chkDate)
GetData()
Dim recCount,data
recCount = Recordset1_total
For intCount = 0 to recCount-1
If chkDate = arrayDate(intCount) Then
response.write arrayData(intCount) & &quot;<br>&quot;
End if
Next
End Function ************

Caution, dates on calendar are closer then they appear.
 
how about not mixing HTML tags with your HREF data.
eg.
strData = &quot;/abc.asp?id=1&quot;

and somewhere down the page where you do presentation,
you will put the strData into the HREF.
 
Actually, I got that part to work. I just removed the quotes after href. ie. &quot;<a href=/more_details.asp?id=&quot; & (Recordset1.Fields.Item(&quot;ID&quot;).Value)& &quot;>&quot; & (Recordset1.Fields.Item(&quot;Person&quot;).Value)& &quot;</a>&quot;

My function is still not printing out the information correctly. ************

Caution, dates on calendar are closer then they appear.
 
The link doesn't work right because the link look like this:
Code:
<a href=&quot;more_details.asp?id=23>Kevin</a>
                               ^ MISSING QUOTE!![code]
instead of using &quot;&quot; to get a quote, [code]<a href='Help.htm'>
works fine too. And it doesn't confuse you with double open quotes and double close quotes.

Some other tips:
Recordset1(&quot;ID&quot;) is the same as Recordset1.Fields.Item(&quot;ID&quot;)

and to loop straight through a recordset use a do...loop like:
Code:
Do
  Response.write Recordset1(&quot;ID&quot;)
  Recordset1.MoveNext
Loop until Recordset1.EOF

Hope these help.

Kevin
 
Yeah. That will help. Thanks. ************

Caution, dates on calendar are closer then they appear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top