vba - Show saved date in label -


I am saving a date in a table like this:

  me! Caption = Set now db = Set currentDb rs = db.OpenRecordset ("background", dbOpenTable) rsAddNew rs! [Date] = me! give and take. Caption rs.Update rs.Close   

I want to read this date from the database and show it in the label:

  sqlstrdate = "background Selection date from "_ & amp; "WHERE SAP_ID = '" _ & amp; me! Sapidtxt.Value & amp; "'" Retvaldate = CurrentDb.OpenRecordset (sqlstrdate)   

Even here it is working, but if I now get the error message in the form of MsgBox or in a label Attempts to display "retvaldate": 13 types of mismatched error.

I am trying to use it to show the date saved in the label.

  me! Last modification.change = (retvaldate)   

To change the label type there or do I change to date type "retvaldate" (which also gives me the same error) There is an option for.

You are trying to set a 'reset' like opening a reset to provide the following correct results (Btw, why do you use reserved words as 'date' in the form of a field name?) dim file record set dull sqlstrdate string sqlstrdate = "date of selection from As background "_ & amp; "WHERE SAP_ID = '" _ & amp; me! Sapidtxt.Value & amp; If you do not have to retvaldate = rs.Fields ("Date") or retvaldate = "No Records" end then rs.Close set = = 'if not set' R '= CurrentDb.OpenRecordset (sqlstrdate) In ... but I hope the variable is in the realm (global, form, subroutine) me! Lastchangedate.Caption = retvaldate

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -