This.
Use DLookup, DSum or a user defined function.
Here is how I do the same thing.
I have function (This could have been Dsum, BTW)
Public Function Sold()
Dim sql As String
Dim rst As New ADODB.Recordset
sql = "SELECT Sum(tblTrans.SellPrice) AS SumOfSellPrice FROM tblTrans"
rst.Open sql...
You'll probably have to convert the macro to a VBA sub routine, and have another sub routine that checks and verifies the files exsistance.
Tyrone Lumley
SoCalAccessPro
http://www.socalaccesspro.com
Assuming you have a user form.
Create a combo, cboData and two textboxes, txtOffset1 and txtoffset2.
Now, create a command button and drag it on the form.
The follwing code should give you an idea on how to access the values in the objects.
Private Sub cmdGetComboData_Click()
MsgBox...
Yeah, you'd have a new table, tblCustLoc for arguments sake.
In that table, you'd store the Main Customer ID and a new Location ID.
Tyrone Lumley
SoCalAccessPro
http://www.socalaccesspro.com
Or....
Create a routine that checks the conencted tables and automatically creates a DSN as needed.
I've done this with success on distributed applications.
Tyrone Lumley
SoCalAccessPro
http://www.socalaccesspro.com
Does your combo have more than one column ?
If so, is the default/bound field the same type as the underlying table you're trying to write to ?
Is the .Attended field boolean ?
Tyrone Lumley
SoCalAccessPro
http://www.socalaccesspro.com
Maybe look in to select case and for next ?
This is just psuedo code, but might give you an idea (I don't even think te allowedvalues property exsists):
Select Case Me.field1
Case cva1
For i = 1 To 4
With Me.Controls
.Item(i).Visible = True...
Well, yeah, with that conditional statement it's still gonna return a record for each phone number, only if it's not the primary it'll return empty string "".
What you really probably want to do is make sure each customer has a phineprimary with a value of one, and inlclude that in your where...
Not unless you have a command button that takes the original data and appends it to an archive table before you delete the record.
What you just descibed is one reason i never give users direct access to tables in my applications.
Another solution I have used is double entry type tables, kind...
...the time. The following SQL was just tested in a query and works fine. fosUserName is the name of the function that gets my user data.
SELECT [2006 USD PRINTER MODEL CNT].*, FOSUsername() AS UsersName
FROM [2006 USD PRINTER MODEL CNT];
Tyrone Lumley
SoCalAccessPro...
Yeah, you need ADO to play with other databases.
I remember the panic back around 2000, and converting TONS of databases from DAO to ADO. I think I even wrote a FAQ for hear.
One of the benifits of working with DAO is, IMO, the ability to access the DB Objects (Table Definitions and Query...
That code you reference is pretty generic for opening a recordset and spitting the results out to excel.
For the data range, simply parametize your query.
For the formulas, it's pretty simple. Look into the Formula property of the cell object ihn Excel.
Tyrone Lumley
SoCalAccessPro...
I've used the same code, and the only difference is I didn't explicitly reference the mail item as an Outlook.mailitem.
I'm looking at code right now that works, and here is part of it:
Dim olApp As Outlook.Application
Dim olMail As MailItem
Set olApp = New Outlook.Application
Set olMail =...
That's because you deleted the join on Range and Code.
Unless I'm totally mis-understanding you, all of the feilds combined should be a unique ID, correct ? Why would you drop 2 fields ?
Tyrone Lumley
SoCalAccessPro
http://www.socalaccesspro.com
Change SQLStatement:="SELECT*FROM qryDDDDocumentMerge"
to SQLStatement:="SELECT*FROM qryDDDDocumentMerge WHERE [Your Field] = YourCriteria"
Dunno about the warning. Have you tried docmd.setwarings = false ?
Tyrone Lumley
SoCalAccessPro
http://www.socalaccesspro.com
I've never done that.
I have done it with powerpoint though.
What I used to do was highlight my chart in excel, copy it, go to PowerPoint, right click, and use paste special.
Actually, I just did it in Access. Use paster Special, Paste Link, Choose Excel Chart in the window.
Updating the...
OK, this will get you every unique combination of records that is the same on both tables, and return the GroupID and the Code from the 2nd table.
Note: I renamed some of your fields as you're using reserved words. Never name a field Type, Name, Range, Etc.
SELECT tblGroupCode.GroupID...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.