Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Assigning date in VB for Access database

Assigning date in VB for Access database

Scheduled Pinned Locked Moved Visual Basic
databasehelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nitingonsalves
    wrote on last edited by
    #1

    Hi I am having a problem assigning a date to a date field in an Access database using VB. I know how to do it using a string. Dim stLinkCriteria As String stLinkCriteria = "[Name] = 'whatever'" Do I somehow use the #'s ? Thanks Nitin

    L 1 Reply Last reply
    0
    • N nitingonsalves

      Hi I am having a problem assigning a date to a date field in an Access database using VB. I know how to do it using a string. Dim stLinkCriteria As String stLinkCriteria = "[Name] = 'whatever'" Do I somehow use the #'s ? Thanks Nitin

      L Offline
      L Offline
      lagbolt
      wrote on last edited by
      #2

      try... Dim strLinkCriteria as String strLinkCriteria = "MyDate = #" & Me.ctlWhatever & "#" the principle being that 1) any string that can be evaluated as a date, and 2) is enclosed in #'s, will 3) be evaluated as a date, so if Me.ctlWhatever.Value = "2/28/03" then... strLinkCriteria = "MyDate = #2/28/03#" 'm/d/yy :zzz: no matter where you go, there you are

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups