• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

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

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
limhodav
Asked:
limhodav
  • 2
1 Solution
 
kriyengCommented:
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
 
John_LennonCommented:
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
 
kriyengCommented:
yes, change to that (add space after the coma)

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

like this ", "

bye
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now