Ok, I'm stuck on how I should do this. Here's what I'm doing.
Button on my form called button1. When I clicke on button1 an audit table inserts a record with "Button1" and my label called lblButton1 is set to visable. (check box, showing me the button has been launched)
When I close the DB, but Button1 label goes back to hidden. I'm trying to use the OnLoad event to code and check my audit table to see if...
User Profile
Collapse
-
Yes, by Ref_Data table has just 1 record and several fields. I just wanted the 1 record so I didn't have to put the results in an array and split all that out and what not. The only question I would have about that suggestion is how I would make it pull the {Value}
I have tried this
But I get an error when I push enter to go to the next line. The error...Code:Public strCs_No As String = GetCS_NO()
-
then just set the dlookup to some variable i need I would assume.
That does seem a little easier... LOL!
Thanks for the help ChipR!Leave a comment:
-
So if I were to use DLookup in this case it would look like this?
In this case?Code:DLookup(join_cs_no, Ref_Data)
Leave a comment:
-
Ok, i got it to work. But can someone look over this and see if it actually done correctly. Or is there a better way of doing this?
Module code
...Code:Public Function GetCS_NO() As String ' Create global variable for cs_no join from the Ref_data table join_cs_no Dim rs1 As New ADODB.Recordset Dim strConn As String ' stores the connection string 'Dim gCs_No As StringLeave a comment:
-
I used the code listed about and add the
like thisCode:strCs_No = GetCS_NO()
...Code:strCs_No = GetCS_NO() Public Function GetCS_NO() As String ' Create global variable for cs_no join from the Ref_data table join_cs_no Dim rs1 As New ADODB.Recordset Dim strConn As String ' stores the connection string 'Dim gCs_No As StringLeave a comment:
-
Public Variables - not populating blank data
OK, I've searched all over and used the help on the VBA editor. Helped a little but I'm not getting close enough to see where I'm going wrong.
I need a public variable that I will be able to use on different forms as part of the join property in a SQL statement. I think it would easier to make it a public so I don't have to create the variable in every button it might be used in. Here is what I've come up with so far. While I get... -
OK!! WOW! I'm special today! I thinking I might need to take a break now.
Ok, So it does help to have the DoCmd.RunSQL SQL20 after the actual SQL statement.
My question was why didn't it do anything when I clicked the button, but after the question about the commented line of code for an old saved query being ignored it clicked.
Sorry all for making such a wondeful error.
thanks for the...Leave a comment:
-
make table with VBA, no errors, but doesn't work either
I posted this in the VB forum but I think its in the wrong place. So I thought I would try here.
_______________ _______________ ___________
Ok, I have a button on a form that I'm using to create another table I will need later in my form. I have created a reference table called Ref_Table (holds my table names - using this as the tables with the orginal data changes from project to project), I have another reference table called... -
VBA no errors, but no table is created?? help?
Ok, I have a button on a form that I'm using to create another table I will need later in my form. I have created a reference table called Ref_Table (holds my table names - using this as the tables with the orginal data changes from project to project), I have another reference table called Ref_Fields (this holds the fields I will need to pull out of the tables they are in.)
I know there is a better way to code some of this so if you... -
Excellent points about the differences in address. Thanks for the code. It will make it that much easier to at least get a jumping off point in searching these. I get a different database each time I do this. So i get to start the process again and I'm just trying to find a more efficent way to compaire and see what my work will call a match. (address number and street) And what doesn't I get to send back for the other company to figure out which...Leave a comment:
-
WOW! Way better then what I was hoping for. Now to work it into what I need. OK. I'm following the varSplit to put the field into an array. To make sure I'm understanding the FOR section.
intIndex is being set to the lower llimit of the varSplit array to the upper limit of the varSplit array. So it is grabing the first part of the array which should...Code:For intIndex = LBound(varSplit) To UBound(varSplit)
Leave a comment:
-
LOL! No, no.. Getting customers from another company. So I'm getting their data. One database has their billing information (lets say this is table1) and the second database is the customer info. Both of these will stay it two different systems after they are converted. Trust me, I would love to get rid of one of these systems.
I just need to be able to match address between the two in order to know if I'm missing anything or need...Leave a comment:
-
Compare address
hello all,
I'm trying to figure out a good way to compare address across two tables. Example: Table 1 has the address of 12345 E Main St and table 2 has 12345 Main.
I need to just look at the numbers and actual street. If they match than I'm good. I've done the below
to split out the numbers, and I can keep...Code:Expr2: Left([table1]![address],InStr([table1]![address]," ")-1)
-
DAMN!! figures i just needed another set of eyes! Thanks for the help ADezii!!Leave a comment:
-
hello, I read your post an i think it would be easier to communicate via email to help you build this. It seems your wanting to create a form, allows multi users to enter data, but must fill out certain fileds (required) and can't save or exit unless the record is complete or message is given that the data will be lost. About right? -
You need to call the total from the sub form to the main form.
Post your code around this field from the sub form and what your trying to put it into on your main form....Leave a comment:
-
Invalid use of ., ! or () - runtime error 3075
Hello All,
I'm in need of help here. I have build my query in a query builder in access as a select query. Query runs fine. Changed it to a make table query. Query makes table ok. Copy and pasted the SQL into my VBA on a form and bam! Run Time error 3075. I've checked and re-checked but I'm not any closer to finguring out where i'm off. If someone could help I would be so grateful! My full code is below. My error message states "Invalid... -
are you trying to do this with a query or a form? How are you adding these items to your total count of product? Little more info in order to help.
-WillLeave a comment:
-
Excellent!! I was using the array as I hadn't heard of the fCopyTable option. I think this is exactly what I was looking for and didn't know what it was called. Happens on an everyday basis! LOL!
Thanks so much Stewart for the example and help!! And thanks to NeoPa for the help as well! I wont get to try it till tomorrow at work. I forgot to send a copy of my database home so I could work on it today. Opps! Guess I'll have to enjoy...Leave a comment:
No activity results to display
Show More
Leave a comment: