Results 1 to 10 of 10
  1. #1
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62

    Help here please for beginner!

    please tell me how to convert ms access vb code to run to sql code?



    like this one?

    Dim DOW As Integer
    DOW = Weekday(DueDate)


    Select Case DOW
    Case 1 'Sun
    GetNewDuedate = DateAdd("d", 1, DueDate)
    Case 7 'Sat
    GetNewDuedate = DateAdd("d", 2, DueDate)
    Case Else 'all other days
    GetNewDuedate = DueDate
    End Select

    please tell me if this code will take effect on my ms access application even if I'm using SQL Server?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    That code should work in VBA.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62
    thank you for reponse sir,
    so that will work? even when I use the sql server database sir?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I don't use SQLServer but it should work. Why haven't you tried?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62
    i did try it now and it worked, thanks a lot

  6. #6
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62
    on the other hand sir, I want to use List Box as a Child field instead Subform in my form, I would like to know how to do it?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why would you want a listbox instead of subform?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62
    coz I think it's clean to look for my project, if ever?
    could you look the at my new thread sir?about passing new data from other form?

  9. #9
    Join Date
    Apr 2017
    Posts
    1,679
    You wanting to use listbox instead of subform probably means you want implement a multi-value field. SQL Server does not support multi-value fields. If you fill a text field with comma or semicolon delimited strings, there is no way to make SQL Server to handle them as separate values. All this must be done through code in front-end (in case this is possible at all). My advice is - avoid them even in fully Access-based Applications.

  10. #10
    markpastoril is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    62
    i see, now i understand btw, am using subform on my database. thanks for that

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Beginner looking for help
    By abztaffyboy in forum Database Design
    Replies: 18
    Last Post: 10-12-2018, 07:00 AM
  2. Help for a beginner
    By Beecharmer in forum Access
    Replies: 1
    Last Post: 03-04-2014, 09:44 AM
  3. 2 Beginner questions
    By Willump in forum Access
    Replies: 9
    Last Post: 01-23-2013, 04:32 PM
  4. Beginner at relationships.
    By Juice118 in forum Database Design
    Replies: 6
    Last Post: 08-02-2011, 09:33 AM
  5. Help a DB beginner
    By adquinn in forum Access
    Replies: 0
    Last Post: 02-08-2011, 08:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums