473,385 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

frustrating

I still am having trouble passing a value to a field in a table.

It's all one database in access. I have my form, tables etc. They filter to combo boxes. Than I sent the value to a text box like someone told me. That works fine. I now want the textbox to send to my field in the table.

I just need an example of how to send, from a textbox on a form, to a cell in a table. Let's make the textbox (mytextbox) and the cell in the table (mycell) and the table (mytable). I just want a basic example with that if possible. I can figure out the rest from there. I pretty much am asking how to make the source of my cell the textbox value. That's all I need to know. It might not even require vigorous programming in visual basic.
Mar 26 '07 #1
3 1214
developing
110 100+
properties> Data (tab)> control source

?
Mar 26 '07 #2
nico5038
3,080 Expert 2GB
I get the impression you're on the "wrong track".
The getting data from (one or more) fields from a table into a form's textbox is OK, but storing such a value is asking for trouble.

The "normalized" way in cases like this is to use the same construction as for filling the textbox in a query, thus amking sure that the data is accurate.

Getting the idea ?
When not, please explain in more detail where the texbox data is coming from and why you want to store it.

Nic;o)
Mar 27 '07 #3
Sorry about that I figured it out the other day. My program is pretty complex so it gets confusing at times. I'm programming a complete database for a lab with drop down menu selections, bench sheets, records etc. I defined a string

strCustomer well I'll show you my code I got it working most of the way.



Private Sub cmdprint_Click()
On Error GoTo Err_cmdprint_Click









Dim stDocName As String
Dim MyForm As Form



stDocName = "tbldate"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acTable, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Text54.Value = Now()
Text54.Visible = True





Exit_cmdprint_Click:
Exit Sub

Err_cmdprint_Click:
MsgBox Err.Description
Resume Exit_cmdprint_Click
End Sub

Private Sub Combo27_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CompanyID] = " & Str(Nz(Me![Combo27], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.Combo29.Requery
Combo29.Visible = True



End Sub


Private Sub Combo27_Change()
cmdprint.Visible = False
Dim strCustomer As String

' define string

strCustomer = strCustomer & "" & Me.Combo27.SelText & ", "

'appending the value to string from box


' remove excess off string in append
strCustomer = Left(strCustomer, Len(strCustomer) - 2)
pass (strCustomer)





End Sub






Private Sub Combo29_AfterUpdate()
cmdprint.Visible = True

End Sub





Private Sub Combo29_Change()

Dim strTest As String ' define string Test to use for append

strTest = strTest & "" & Me.Combo29.SelText & ", " 'append string from combobox


' to remove excess comma stored in append
strTest = Left(strTest, Len(strTest) - 2)
pass2 (strTest)

cmdprint.Visible = True
End Sub



Private Sub Form_Load()
Text54.Visible = False
Combo29.Visible = False
cmdprint.Visible = False





End Sub



Sub pass(x As String)

Dim store As String

store = x
If cmdprint.Visible = True Then



Dim strSQL As String

strSQL = "INSERT INTO TablePrint (CustomerPrint) " & _
"VALUES('" & store & "')"
DoCmd.RunSQL strSQL


DoCmd.GoToRecord , , acNewRec
End If







End Sub
Sub pass2(y As String)
Dim store2 As String
store2 = y
If cmdprint.Visible = True Then

Dim strSQL As String




strSQL = "INSERT INTO TablePrint (CustomerTest) " & _
"VALUES('" & store2 & "')"
DoCmd.RunSQL strSQL


DoCmd.GoToRecord , , acNewRec

End If
End Sub
Mar 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: sjanie | last post by:
The error code is: Microsoft JScript compilation error '800a03ec' Expected ';' /bicc.nl/Connections/BICCwebsite.asp, line 2 Set Conn = Server.CreateObject("ADODB.Connection") ----^
11
by: Michael Lang | last post by:
You'd think that the advantage to extra decimal places in a data type is better accuracy. Well think again. Look at this method and test results: ...
0
by: Marina | last post by:
I copied my project on a new computer and try to debug it. When solution is built the exe.config file is completely gone !!!! (not jast from the project but from the hard drive too). Can...
1
by: John | last post by:
Hi I have a very frustrating problem. I had a perfectly working app with a sub form on a main form. I added a few fields in tables here and there and now I can not enter data on in the sub form...
0
by: Rob Levine | last post by:
(This post also available at http://roblevine.blogspot.com/2004/11/frustrating-http-connection-behaviour.html in a slightly more readable format!) Hi All, I seem to be having a bit of a...
3
by: David Cho | last post by:
I've noticed that my code in InitializeComponent where I am linking event handlers to events vanishes from time to time. One of the things that triggers the disappearance is when I do something...
3
by: Loui Mercieca | last post by:
Hi, I have a very strange and frustrating error. I developed an application, tested it and it works fine. Then i deploy it to another machine ( no installation, direct file transfer ) but it...
2
tpgames
by: tpgames | last post by:
Not a question. Just didn't know where to put this montage. So realtek gave me a exe that will create a dump. The device refused saying that it only works with realtek. Like Duh! So, I let the...
4
karlectomy
by: karlectomy | last post by:
Can anyone find the parse error on the fourth line of this stuff?? <table><tr> <td>Date</td> <? var $thisDate = time(); //NOW var $day1 = (7*3600); //One more day for($i = 7; $i>=0; $i--) {
3
by: Sejoro | last post by:
At this point in life, I thought syntax wouldn't be a problem, but it is. I'm trying to write yet another school program, but keep getting compile errors in the main function when I try to pass an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.