Solved Small issue to get the field value using VBA

rehanemis

Registered User.
Local time
Today, 20:28
Joined
Apr 7, 2014
Messages
195
Hi, I am wondering about a small issue which I am facing to get the ID from a table using Function call. It is working perfectly on my other MS Access program but not on the currently attached. If you open frm_Customers and hit show button you will see it giving error Object required.

Can any one troubleshoot and share what is the issue?

Thanks!
 

Attachments

There is no object named txtCID.

Did you debug?

Why using unbound form?
 
I would like to learn about how to deal using unbound and all to deal using vba.
I have made field txtCID and it showing the results.
 
any suggestion from your side as i would like to design POS retail system.
so approach is good as I also want to learn.
 
The forum has a decent SEARCH ability so try searching for "POS" or "point of sale" within the forum. I recall some threads on the subject but not recently.
 
Does your other working application connect to SQL Server? Because it looks like that function takes a ADODB type of connection. In this example, you are trying to use it on a local table.
 
If you open frm_Customers and hit show button you will see it giving error Object required.
Code:
Public Sub Reset()
Dim txtCID As Variant
'txtCID.Value
txtCID = AutoNumberReturn("tbl_Customer", "CID")
Me.CustomerID.Value = AutoNumberReturn("tbl_Customer", "CID")
MsgBox Me.CustomerID.Value & " or  " & txtCID


End Sub
 

Users who are viewing this thread

Back
Top Bottom