This topic is locked

Lookup Fields

4/13/2007 12:35:39 PM
ASPRunnerPro General questions
M
MikeGinMN author

I am working on a project that is connected to an SQL database. I have a table called registration which I put special olympics registrations into. There is a table called people that I can get an athletes ID#, name and delegation from. Is there a way instead of three lookup dropdowns to get the information into the other two from selecting it from one.
Example - I lookup athlete name from field called name in table "people" and store in field AthleteName in table "Registration", I would like Code from "people" to be stored in StateID in "registration" and Division from "people" into Facility in "Registration." One other item I only want the people that are associated with that coach to be shown - it uder database I have a field call association (linked to facility) which I use to just show their athletes
Have used access in past, so am rather new to SQL - if you could give me an idea how to do this or where to look that would be great
Thanks for your time and help

Sergey Kornilov admin 4/16/2007

It looks like you need to create three dropdown boxes and make them all dependent on first one.

In this case you only need to choose first field value to populate all three of them.

M
MikeGinMN author 4/17/2007

Thank you that works great - now how do I limit the dropdown selection(s) to be just the ones assigned to my team. In list I see just my team members - no one else - I want that to be same for that drop down box
Thanks for your time

Sergey Kornilov admin 4/17/2007

MikeGinMN,
you can use WHERE clause in Lookup Wizard settings to filter data.

See provided examples for more info.

M
MikeGinMN author 4/23/2007

That works - definitiely need to use my tax return to buy this - like what I see. Another question - as part of my project I have a list view of an inidividual's expiration dates of forms called expdate. I would like to do a couple of things
1st - if date is less than cuurent date it is expired and I would like to highlight the cell in red
2nd - if date of form will expire within 60 days of today's date highlight cell in green
and 3rd - this would be to at the registration view of a participant highlight their name if either of their 2 forms are outdated or will become outdated - so that the coach will know to look at the form status list to see what form needs to be update.
I know you are busy so if you could give me an idea how to and where I would find that part of the web site in the asp files generated would be great. Should be able to hack my way through until I get it to work
Thanks for all your help and thank you for developing such a super product

J
Jane 4/24/2007

Mike,
please see my answers below:
1,2. to highlight values on the List page use Custom formatting on the "View as" settings dialog on the Visual Editor tab.

Here is a sample:

if InStr(Request.ServerVariables("SCRIPT_NAME"), "_export")<1 then

str = "<table width=100% bgcolor="

if strValue<Now() then

str = str & "red"

elseif strValue<Now()+60 then

str = str & "green"

else

str = str & ""

end if

str = str & "><tr><td align='center'>" & strValue & "</td></tr></table>"

strValue = str

end if


3. to highlight participant name use ViewOnLoad event and Custom formatting on the "View as" settings dialog.

M
MikeGinMN author 4/24/2007

I'm trying to get the name highlight - but nothing seems to happen - here is the code I put in
Sub ListOnLoad()

'** Check if specific record exists ****

strSQLExists = "select * from ViewFormStatusAthletics where ExpDate< GetDate() + 61"

set rsExists = CreateObject("ADODB.Recordset")

rsExists.Open strSQLExists, dbConnection
if not rsExists.eof then

' if record exists do something

str = "<table width=100% bgcolor=Red ><tr><td align='center'>"

else

' if dont exist do something else

str = ""

end if

rsExists.Close : set rsExists = Nothing
End Sub
I'm sure it me - but can seem to see what I'm doing wrong.
Also can some one email me with a price for a non-profit (if you have a special pricing for them) and how I would go about ordering asprunner for use with sql server
Thanks

Sergey Kornilov admin 4/25/2007

Mike,
please contact me directly at support@xlinesoft.com.
I'd be glad to help you with getting a special non-profit price and also with remaining issues.