?
Solved

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

Posted on 2006-04-20
4
Medium Priority
?
253 Views
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?  
0
Comment
Question by:limhodav
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
kriyeng earned 2000 total points
ID: 16497137
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
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        
      'MY ADDED CODE
      if MM_delim= "#" Then
            
                                MM_formVal=replace(MM_formVal,",","/")

            Dim strDay
            Dim strMonth
            Dim strYear
      
            strDay=day(MM_formVal)
            strMonth=month(MM_formVal)
            strYear=year(MM_formVal)
            
            MM_formVal= strYear & "/" & strMonth & "/" & strDay
            
      end if
      'FINISH ADDED CODE
             
        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
0
 
LVL 6

Expert Comment

by:John_Lennon
ID: 16499866
i think you have to add this line
MM_formVal=replace(MM_formVal," ","")
before
MM_formVal=replace(MM_formVal,",","/")
because values will come like '3, 4, 2006'

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

Expert Comment

by:kriyeng
ID: 16501802
yes, change to that (add space after the coma)

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

like this ", "

bye
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Loops Section Overview
Suggested Courses

807 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