Here's my code, combo27 is working fine, however when I update my table Test (field Test) which works fine, I can't get Combo29 to update to the added test I just put in. I need to use the acLast or something like it to bring my record up, which works, however, it's numeric. I need to know how to bring the string value in the cell back to my drop down Combo29 here's my full code and form for the whole database, take a looksee if you want.
[IMG]C:\Documents and Settings\Justin\Desktop\form.jpg[/IMG] -
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
-
DoCmd.GoToRecord acDataForm, "Test", acLast
-
-
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
-
-
#################
-
-
Private Sub Add_Test_Click()
-
On Error GoTo Err_Add_Test_Click
-
Dim clienttest As String
-
Combo29.Visible = True
-
clienttest = InputBox("Enter Test Data Please, seperate with commas")
-
-
updatecombo29 (clienttest)
-
-
Exit_Add_Test_Click:
-
Exit Sub
-
-
Err_Add_Test_Click:
-
MsgBox Err.Description
-
Resume Exit_Add_Test_Click
-
-
End Sub
-
-
#######################
-
-
Private Sub Add_Client_Click()
-
On Error GoTo Err_Add_Client_Click
-
Dim clientname As String
-
clientname = InputBox("Enter Client Name")
-
Combo27.Value = clientname
-
-
DoCmd.GoToRecord , , acNewRec
-
-
Exit_Add_Client_Click:
-
Exit Sub
-
-
Err_Add_Client_Click:
-
MsgBox Err.Description
-
Resume Exit_Add_Client_Click
-
-
End Sub
-
-
###################
-
-
Sub updatecombo29(update As String)
-
Dim change As String
-
Dim lastrecord As String
-
-
change = update
-
-
Dim strSQL As String
-
-
strSQL = "INSERT INTO Test (Test) " & _
-
"VALUES('" & change & "')"
-
DoCmd.RunSQL strSQL
-
DoCmd.GoToRecord , , acNewRec
-
-
End Sub
-
12 1734
http://i147.photobucket.com/albums/r301/chembuff1982/form.jpg
that's a picture of my form I took a snapshot of, not an advertisement. It's in my photobucket.
anyone? Almost there, almost there, so close to being done.
Try this ... -
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
-
-
Me.Combo29.Requery
-
-
End Sub
That doesn't work, I did try that a while ago, see the table, is updated by the form, but I'm trying to sort of refresh the new drop down box with the new selection. Would some form of acLast work? I got aclast to pull up a number for the new record, but I need a string value.
So frustrating, it's the last button on the form. I have it sending to the table, just need ot repopulate my combo29 box which is for client tests. I want it to do it from the add test button. So if a current client has no selection or they are a new client it will allow them to enter test parameters.
So frustrating, it's the last button on the form. I have it sending to the table, just need ot repopulate my combo29 box which is for client tests. I want it to do it from the add test button. So if a current client has no selection or they are a new client it will allow them to enter test parameters.
Sorry I'm genuinely lost as to what you're trying to do :)
my rowsource for combo29 (tests) is filtered by companyID number, however if we add a new test for a company, or add a new company, I want to be able to put that new test from add test in the Combo29 (tests) box before the form is submitted.
my rowsource for combo29 (tests) is filtered by companyID number, however if we add a new test for a company, or add a new company, I want to be able to put that new test from add test in the Combo29 (tests) box before the form is submitted.
So your problem then is when to trigger the requery.
How are new tests being added?
The new tests are being added by a command button.
Add New Test
The new tests are being added by a command button.
Add New Test
Put the requery here -
Private Sub Add_Test_Click()
-
On Error GoTo Err_Add_Test_Click
-
Dim clienttest As String
-
Combo29.Visible = True
-
clienttest = InputBox("Enter Test Data Please, seperate with commas")
-
-
updatecombo29 (clienttest)
-
Me!Combo29.Requery
-
And maybe put it in the Load event of the form.
Mary
Nope both changes didn't work. I think we came upon a mystery of computer programming.
I'm going to try to go to the local college to get help. It seems like nobody on here can figure the last part out. I called already, just going to talk to a professor who has a degree in computer science.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rey |
last post by:
Howdy, all.
Appreciate your help. Have a one to many relation between a client and
visit table.
In the visit subform, I have a visittype and counselor field which are
comboboxes. If I set...
|
by: Alienz |
last post by:
hiya!
I wanted to make a multiple selection drop down list and I found the
easiest way to do this was by creating a subform linked to a table
with 2 values, the 1st value links to the main form...
|
by: thebison |
last post by:
Hi all,
I hope someone can help with this relatively simple problem.
I am building a timesheet application using ASP.NET C# with Visual
Studio 2003.As it is only a protoype application, my...
|
by: Per |
last post by:
Hi,
I have a problem that I can't figure out. I have a database application
to keep track of boxes that contain files. For data entry, I have a
form with a main form section for the box-specific...
|
by: uthooker |
last post by:
I have an Access form with some combo boxes in the Form Header that are
enabled/disabled using conditional formatting based on the setting in a
checkbox also in the Header (Combo box = Enabled by...
|
by: lwwhite |
last post by:
Another question. On one of my forms, I have two radio buttons: Topic and Window. Beside each of them is a drop-down to select the corresponding topic or window. When Topic is selected the window...
|
by: sara |
last post by:
Hi -
I have been struggling with solution ideas for this now for almost 2
weeks, and have not been able to figure this out.
I have a user who creates a Purchase Order (tblPOData). In some...
|
by: kcddoorman |
last post by:
I have a main order table that gets some of its information from several look up tables. A create a look up relationship between the two tables and that allows me to choose a record. I can create...
|
by: daverskully |
last post by:
I have two tables created and want to link two forms created from these tables so that specific fields are populated once one field is selected, but not all fields being populated, with a new record...
|
by: daverskully |
last post by:
I have two tables created and want to link two forms created from these tables so that specific fields are populated once one field is selected, but not all fields being populated, with a new record...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |