This topic is locked

HOW to set a default value for a field on an Add Page

3/10/2009 6:58:07 PM
ASPRunnerPro General questions
C
Conrunner author

Hello

I am a real newbie to all of this and would really appreciate any advice. I shall try to describe my problem step by step...

  1. I have two tables, Table 1 and Table 2. I use the Add Page for Table 1 to enter usernames and passwords for specific managers and then use the print

    page for Table 1 to generate a letter to these managers informing them of what their usernames and passwords are. (I am asking them to provide me with

    feedback basically)
  2. The managers recieve their letters and use their usernames and passwords to access specific data in Table 1. On this page however is also a link to the

    ADD page for TABLE 2 and the managers use this page to submit feedback data to TABLE 2
  3. When the manager hits this link the ID Number from Table 1 (Table 1 contains their username and password so in a sense is a "Lookup" table) is

    automatically entered into thier corresponding record in Table 2 and this is how the records in Tables 1 and 2 are linked
    I am not the only person however who enters data into Table 1 - there are others as well - (We are doctors asking managers for feedback on advice we have given them). I would like each doctor to be automatically e-mailed each time a manager replies. The doctors' e-mail adresses are present in Table 1, but not in Table 2, which is the table to which managers are submitting their feedback. What I want to do basically is...
  4. Create a field in Table 2 named "Doctor's E-Mail" (There is a "Doctor's E-Mail" field in Table 1 which is automatically populated when a doctor is

    logged in, enters a new manager UN and PW and requests advice)

    2 Assign a "default value" for the Doctor's E-Mail field in Table 2 which is determined by

    -Looking at the ID Number in Table 2

    -then looking for the corresponding ID Number in Table 1

    -then looking for the corresponding E-Mail Address in the Doctor's E-Mail field in Table 1
  5. Automatically enter the corresponding Doctor's E-Mail address in Table 1 into the Doctor's E-Mail address in Table TWO so that this field can then be used

    as the "User E-Mail" Field in the project for Table 2
    Basically what I am trying to do is to get fields in a record in one table to automatically reflect the values in related fields in another table but am unsure of the VB Script (Sorry - not unsure - don't have a clue). I have used the " Session("_" & strTableName &"_OwnerID") " thingy to automatically fill in fields in Table 1 depending on which doctor is logged on, but do not know how to modify this further.
    I really would appreciate any help that anyone could give me, although on reading what I have just typed I am indeed dubious as to whether anybody will actually understand what my problem is, let alone know how to solve it!
    Many Thanks.

    Con.

R
Roger 3/10/2009

You can do this in the Function BeforeAdd(dict,message,inline) Event, similar to this:
dict("Contact_Name")=PCase(dict("Contact_Name"))
Roger

C
Conrunner author 3/11/2009

You can do this in the Function BeforeAdd(dict,message,inline) Event, similar to this:

dict("Contact_Name")=PCase(dict("Contact_Name"))
Roger


Hi Roger

Thanks, but I don't really understand. Is "Contact_Name" the name of the column? If so must the column have the same name in both tables?

Many Thanks

Con

Sergey Kornilov admin 3/11/2009

Con,
I think you can have better luck posting your application to Demo Account (use 'Demo Account' button on the last screen in program) and contacting support team directly at http://support.xlinesoft.com.