Databse to populate dropdown with ability to add entry

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I am creating a Training Class Entry Form with two MS ACCESS database fields
CLASS and DATE

CLASS would be the Subject of the course where the names of the previous
classes would be available to be selected on a dropdown but also I want the
user to be able to enter a new class name on the top line if a previous name
did not exist.

DATE would be the same as the CLASS. If the date is available in a dropdown
then the user can select it, but if the date did not exist, a new date could
be entered on the top line.

I am using FP2003. Can this be done?

Thanks
 
You would have to add a choice to the Class Drop Down, say "Other" and then have a text field
"Other1" below the Class Drop Down for the user to enter the item, then in your ASP Update or Add
code, you check to see if the value of the Class Drop Down is "Other", then instead of using the
Drop Down value, you would grab the value enter in "Other1" and write that to "Class" field in the
database.

You will also need to write some error check code to avoid the user adding a duplicate entry.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Thanks

Is there sample script somewhere on the If Other is selected then enter
Other1?

I can most of this if I can see a sample first.

Dave
 
<%
Dim Class1
Class1 = Request.Form("Class")

If Class1 = "Other" Then
Class = Request.Form("Other1")
Else
Class = Request.Form("Class")
End If
%>

then pass the value of Class to your Add or Update statement.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Tom thanks for your help!

This will get me started.

I posted another question about multiple dropdowns..

If you time take a look

Dave
 
I always do this in steps, so the user would select the first item on the first page, which then
post to the second page with next set of values, otherwise you have to use JavaScript Arrays (I can
not provide you with any help using arrays) to populate the drop downs and adjust them based on the
selection in the first drop down. This mainly become issue when you have a lot of record, as the
content for each drop down is loaded on page load.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top