Submit date in 3 combo boxes into database without passing control to another asp page?

Posted on 2006-04-20
Last Modified: 2008-03-17
I have a question.  

I know how to allow users to enter date using 3 combo boxes (dd, mm,yy) and then passing it thro another asp page to be processed into the database.

The only problem is that I have other details to process too.  I use the Dreamweaver built in Insert Record behaviour whose action is <%=MM_editAction%>  and it's actually processed in the same page and not to another page.

So how can I combine the fields from the combo boxes and insert into the database without passing conttrol to another asp page. My field in database is dd/mm/yyyy.

or is there a better alternative?  
Question by:limhodav
    LVL 2

    Accepted Solution

    first of all put the same name to the three date input fields.

    edit your insert/update record using dreamweaver tool to pass ms access date to post form.

    now, locate this lines in your dreamweaver code: (look over line number 90, depending your code could change) and add the lines between 'MY ADDED CODE and 'FINISH ADDED CODE like below

        If (MM_formVal = "") Then
          MM_formVal = MM_emptyVal
          If (MM_altVal <> "") Then
            MM_formVal = MM_altVal
          ElseIf (MM_delim = "'") Then  ' escape quotes
            MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
          'MY ADDED CODE
          if MM_delim= "#" Then

                Dim strDay
                Dim strMonth
                Dim strYear
                MM_formVal= strYear & "/" & strMonth & "/" & strDay
          end if
            MM_formVal = MM_delim + MM_formVal + MM_delim
          End If

    This code I usually use to make dates universal with no country problems to save in access database. I added a replace function MM_formVal=replace(MM_formVal,",","/")   to solve your problem. I've not tested. try it.

    good luck
    LVL 6

    Expert Comment

    i think you have to add this line
    MM_formVal=replace(MM_formVal," ","")
    because values will come like '3, 4, 2006'

    MM_formVal=replace(MM_formVal," ","")
    MM_formVal=trim(MM_formVal) 'just it case
    LVL 2

    Expert Comment

    yes, change to that (add space after the coma)

    MM_formVal=replace(MM_formVal,", ","/")

    like this ", "


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now