View Full Version : Txtdoinp


withoc
06-05-2008, 11:44 PM
Morning all,

I am missing "TXTDOINP" from my library... any ideas where I get it from?

I use it to transfer Data from a Field on an unbound form and put it into a database using code.

e.g.
Dim rs As Recordset
Set rs = CurrentDb().OpenRecordset("tblLog")
Me.txtDoInp = Now (As this is not in my Library it will not add to the database)
rs.AddNew
rs("FullName") = Me.cboName.Column(1)
rs("AssociateID") = Me.txtID
rs("TM") = Me.cboTM
rs("Coach") = Me.cboCoa

Any help would be greatly appriciated.

DCrake
06-06-2008, 12:06 AM
You seem to be somewhat confused with your coding practice

Set rs = CurrentDb().OpenRecordset("tblLog")

Should be:

Set rs = CurrentDb.OpenRecordset("tblLog")

Me.TxtDoInp is the name of a control on your form

Now() is an inbuild function to return the current date and time, where Date() only returns the current date.

CodeMaster::cool:

withoc
06-06-2008, 02:55 AM
You seem to be somewhat confused with your coding practice



Should be:



Me.TxtDoInp is the name of a control on your form

Now() is an inbuild function to return the current date and time, where Date() only returns the current date.

CodeMaster::cool:

Many thanks for your help...

withoc
06-06-2008, 03:12 AM
I am using this "Me.TxtDoInp" in code but the function is not listed in my Library so will not accept the code.
I need this code to be able to transfer data within the filed to a table.

Any help is greatly appriciated.

withoc
06-06-2008, 03:13 AM
I am using this "Me.TxtDoInp" in code but the function is not listed in my Library so will not accept the code.
I need this code to be able to transfer data within the filed to a table.

Any help is greatly appriciated.

DCrake
06-06-2008, 03:34 AM
Go to your immediate window (Ctrl+G) then enter the following

?Now()
It should echo the current date and time on the next line.
If not you need to check your references for missing objects

CodeMaster::cool:

withoc
06-06-2008, 04:00 AM
Go to your immediate window (Ctrl+G) then enter the following

?Now()
It should echo the current date and time on the next line.
If not you need to check your references for missing objects

CodeMaster::cool:

This is great info many thanks.. I still need help getting "txtdoinp" into my library if you can share any ideas?

Chris

DCrake
06-06-2008, 04:39 AM
Forgive my ignorance but what the hell is txtdoinp?

Your original post read

Me.TxtDoInp = Now()

That reads to me that you have a textbox control on a form that you want to equal the current date and time. Your comments about Library baffles me.

David

withoc
06-06-2008, 04:44 AM
Forgive my ignorance but what the hell is txtdoinp?

Your original post read

Me.TxtDoInp = Now()

That reads to me that you have a textbox control on a form that you want to equal the current date and time. Your comments about Library baffles me.

David

Its a line of code, it means Me (my recordset) . txtdoinp (text do input) and when to input it.

raskew
06-06-2008, 05:03 AM
Re txtdoinp -- there is no such thing in Access libraries.

At best, it's a UDF (user defined function) which you may have had in a different DB.

But the question is, why do you need it? To set a control to the current date/time, Me.ControlName = Now()

Bob

withoc
06-06-2008, 05:53 AM
Re txtdoinp -- there is no such thing in Access libraries.

At best, it's a UDF (user defined function) which you may have had in a different DB.

But the question is, why do you need it? To set a control to the current date/time, Me.ControlName = Now()

Bob

The time only comes in as to when to enter the new text into the database.

txtdoinp means textbox do inout (Converts contents of a text or recordset to a database)

within the object browser you will see a list of libraries where also you would find Docmd etc.

Chris

gemma-the-husky
06-06-2008, 06:13 AM
it may show as a library error, but the expression

me.txtdoinp refers to a control on a form

if you want a variable just do

dim txtdoinp (as some variable type)
then just
txtdoinp = whatever