How To Replace Hard Coded Path Of Current Db

Aug 2, 2006

I have something like this
Code:'sets generic workspace Set ws = DBEngine.Workspaces(0) 'sets target database from workspace ******NOTE hardcoded path****** Set db = ws.OpenDatabase("E:Status ReportstatusReport_Test.mdb") 'sets Recordset to deliverablePercentComplete sql statement for target database Set rs1 = db.OpenRecordset(deliverablePercentComplete)

is there a way to replace the path in the set db call, basically it is the current database that is being worked on, thus it is the current database that is opened, is there a way to say something like...

set db = ws.OpenDatabase(currentDB)

View Replies


ADVERTISEMENT

Modules & VBA :: Replace Hard Code Directory Path With Textbox

Jun 17, 2013

How do I direct the ZipFilePath and ZipFolderPath to use a directory I define in a textbox in a form? Instead of hard code like it is now?

Option Compare Database
Option Explicit
Public Sub NewZip(ZipFilePath)
On Error GoTo Err_NewZip
Dim lngFile As Long
lngFile = FreeFile

[Code] ......

View 2 Replies View Related

Hard Coded Dymanic Fields

Feb 6, 2006

Having one of those days!!!

I have a simple query populating fields from 2 tables and would like to add a further field to my query (not in tables)

In this field I wish to hard code in 2 values. Can anyone suggest the best way of doing this?

Thanks

Paul

View 1 Replies View Related

Populate Combo Box From Values Through Query And Hard Coded Value At Same Time

Jun 18, 2015

Currently I have a combo box in my access 2007 application which is drawing its value through a table using a SQL Query. I would also like it to show up a hard coded value in addition to the current list.

View 3 Replies View Related

Current Folder/path

Jun 11, 2006

Hi all

How can I change the output string in the command below to simply save the document to the same folder that the DB resides??

DoCmd.OutputTo acQuery, "qryAwardsExportWord", "RichTextFormat(*.rtf)", "C:dataawards.doc", True, "", 0

any help is appreciated

View 2 Replies View Related

Query For Current Database Path

Apr 27, 2007

I used to know how to get the path for the current database by running a query. I forgot how to do it. I am using Access 2003. I have tried querying the msystem tables without success. I have searched forums and the web without success. Anyone? Thanks!:)

View 1 Replies View Related

Queries :: Make Replace Query To Look In Order To Find What To Replace

May 6, 2014

I have this working query:

Code:
INSERT INTO TB_SISTEMAS ( LOGIN, SISTEMA, PERFIL, DATA )
SELECT Left([dbo_BACKUP_ACESSOS.LOGIN],255) AS LOGIN, dbo_BACKUP_ACESSOS.SISTEMA, Left([dbo_BACKUP_ACESSOS.PERFIL],255) AS PERFIL, dbo_BACKUP_ACESSOS.DATA
FROM dbo_BACKUP_ACESSOS
WHERE (((dbo_BACKUP_ACESSOS.SISTEMA)<>"ACTIVE DIRECTORY") AND ((dbo_BACKUP_ACESSOS.DATA)="2014-03-23"));

But Iwant to be able to use a set of data to be used in the Replace Statement, so I create a table to add each string I would like to have replaced by "nothing", and trying to make the replace query to look there in order to find what to replace.I also created a table where I will list the systems that I dont want in the select, so I removed the "ACTIVE DIRECTORY" and replaced by the colum that have the list of system I dont want listed.This is the result:

Code:
INSERT INTO TB_SISTEMAS ( LOGIN, SISTEMA, PERFIL, DATA )
SELECT Replace((Left([dbo_BACKUP_ACESSOS.LOGIN],255)),[PREFIXOS_E_SUFIXOS]![Valor],"") AS LOGIN, dbo_BACKUP_ACESSOS.SISTEMA, Left([dbo_BACKUP_ACESSOS.PERFIL],255) AS PERFIL, dbo_BACKUP_ACESSOS.DATA
FROM dbo_BACKUP_ACESSOS
WHERE (((dbo_BACKUP_ACESSOS.SISTEMA)<>[SISTEMAS_EXCLUIDOS]![Sistema]) AND ((dbo_BACKUP_ACESSOS.DATA)="2014-03-23"));

The thin is that this keeps asking me to enter the parameter value for "PREFIXOS_E_SUFIXOS!Valor" and for "SISTEMAS_EXCLUIDOS!Sistema"

View 6 Replies View Related

Coded Example, Will It Work.

Aug 10, 2005

SELECT Table1.T1Field1, Table1.T1Field2, Table1.T1Field3
FROM Table1, Table2
WHERE (((Table1.T1Field1)=[Table2].[T2Field1])
AND ((Table1.T1Field2)=[Table2].[T2Field2])
AND ((Table1.T1Field3)=[Table2].[T2Field3]));

I took this code off another thread, and wodnered if it would work for mine.
I have two tables in the database, one is data we update monthly the other is data we get send monthly, each customer has a unique id, but not customer id's are included in the data we get sent. I need to match the customer by their id then the name and then the product group.

So firstly i want it to check the id if there is an id match then i want it to look for the product group. If there is no id i want it too look for the name then the product group. Will the code above work by doing this.
Thanks

View 2 Replies View Related

Save Reports To Defined Path In Path Field

May 26, 2014

Till now I managed to publish and save all in C:Reports. What I'm trying to do is Save to path specified in Path. DB attached.

Private Sub PrintAll_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim MyPath As String
Dim MyFileName As String

[Code] ....

View 6 Replies View Related

Modules & VBA :: Amend Coded Command Buttons Using Code?

Dec 10, 2013

I want to be able to change certain parts of a Query and Code based on the contets of a text box.

Example with Command Button Code:

Textbox contains the name Tom

This is a command button on a form that i have copied and renamed etc through VBA to Tom (contents in the textbox)

DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings (False)
DoCmd.OpenQuery "Qry BM to Management", acViewNormal
DoCmd.SetWarnings (True)
DoCmd.GoToRecord , , acNext

I now want to change where it says "Qry BM to Management" to "Qry Tom to Management",

Example with Command Query:

Again Textbox Contains Tom

Query has been copied but now i want to change the following SQL string from where it says Bhavins Table to Toms Table

INSERT INTO [Management Table] (Postcode)
SELECT [Bhavins Table].Postcode
FROM [Bhavins Table];

Im not sure if this is possible but i would like to know as adding a new user to my Database takes me about 10-15 minutes but I know what im doing (copy paste change specific parts of Queires and points of forms etc ) but i need to make it easy for management to add new Users....

View 2 Replies View Related

How To Export A Product From Access Into Excel With Cells Color Coded

Aug 14, 2014

I'm trying to export my queries into an Excel product color coded to one simple field. for example if a aircraft in maintenance will only be available for four months from oct-Jan in the Pacific i want it colored blue. I want it keying off the region EX: (Pacific) So far It shoots out the product with one color, and I have to manually change the colors in Excel.

View 2 Replies View Related

Queries :: Soft Coded Date Filter Causing Query To Run Slow

Jan 2, 2015

created a query (in Access 2010) that joins several linked tables (to an Oracle database). The query runs in about 20 seconds when I filter with a hard coded date (e.g., #12/31/2014#). The Oracle table column Im filtering on is defined as date/time.

When I attempt to change the hard coded value to a soft coded value (e.g., Forms![Form1]![Latest_Extract_Date]), the query runs over 5 minutes. In this case, the form field has the exact same value (12/31/2014).

Ive encountered similar issues using Access 2000, 2003, etc. This is quite frustrating. Does Access interpret #date value# is a special way? Is there a way to trick Access into the thinking a soft coded date is a hard coded date?

View 1 Replies View Related

Too Hard For Me...Help

May 16, 2006

hi all,
I'm just beginning to know the world of Access so maybe the solution for my problem is pretty simple.
I have a huge database with Itemcodes, Costprice of materials and EffectiveDate (date on which new prices are valid). These dates represent past dates as well as future dates. The one that interests me the most is the most recent date in the past.
What I would need is a query that filters out the most recent date per itemcode because right now there are several prices with several validity dates. Eventually it should result in a database that shows an item with one validitydate and one price.
Right now the same itemcodes are repeated because different validitydates are related to it.
I really hope somebody can help me out on this.
Thanks in advance.

View 2 Replies View Related

Hard For Me, Easy For You!

Jan 17, 2006

I really have got a mind block!

I am creating a small DB for a vast CD collection and have 3 related tables at present.

I want to have 1 table with the artists, but have it updated when I add a new artist on the main table/form.

So the form does not have the artist. I add that artist, and it is added to the artist table for future use.

Sure I can do this, but cant rememebr how. Please help :)

Jay

View 3 Replies View Related

Need Help With Hard Query

Jul 8, 2005

My DB has a table named noldba.int_member_history, which contains the following fields:
member_id,
date_start,
date_end,
member_status,
iva_case_id,
case_id,

It is possible for the member to have several lines of data under their same member_id like this:

member_id date_start date_end member_status iva_case_id case_id

20125626 12/1/1990 2/31/1990 N 21116625 20002717C
20125626 1/1/1991 4/30/1992 A 62574431A 20002717C
20125626 5/1/1992 8/31/2000 N 20006625 20002717C
20125626 9/1/2000 12/31/9999 M 21116625 20002717C
20125626 8/1/2000 12/31/9999 M 20111832 20090698C

So this member had 4 start and end dates under case 20002717C
and only 1 start and end date under case 20090698C

I'm trying to write a query which is looking for member_id's along with a case_id which only has one member_status returned from the query and the
member_status must be M. In this case the member has two cases which have the M member_status, but case 20002717C has other types of member status so I would not want the query to return the 20002717C case, only the 20090698C
I'm sure Im asking for something that can't be done...but I'd never know unless I asked. Thanks

View 1 Replies View Related

This Shouldnt Be Hard.

Sep 6, 2005

I need a query that will return values of a customer number that have been created within the last week.

There is a customer_code field and a date_created field.

Any help would be appreciated.

View 7 Replies View Related

Year Only -haw Hard Can This Be!!!

Aug 24, 2006

I want a field in a table that is a date but that is the year only.
I only want this because I want to be able to filter my charts to show one or a span of years for comparison. I have criteria in a query that states between [forms].[charts].[begin] and [forms].[charts].[end] and the corresponding form that my user puts the desired begginning and ending dates into before pressing buttons that bring up the charts based on the query.

My problem is that I can't even get the table to take a year only date. If I leave the date field as text the between clause in the query won't work. I tried it as a number with >= etc. and that didn't work either.

How hard can something this simple be?

Please help me oh cyberspace wizards.

View 9 Replies View Related

Simple But Hard If You Dont Know

Jun 10, 2005

I have created a database in which I have three Fields.
1. Date Joined
2. Renewal Date
3. Member/Renewal

When I type in the date a person joins our club, I have made the renewal date come up displaying a year ahead, when renewal of membershiip is due.

I would like to be able to put in the date joined date and have the field 3 show Member and then when the renewal date is reached, to have in automatically change to Renewal.

It is probaly a simply formula but I can not get it right.

Please Help.

Foxy

View 6 Replies View Related

A REALLY Hard Query Question

Aug 12, 2005

Hi,

Currently I have one query that prompts the user for a beginning date, and end date of a week. It then proceeds to show the user all records in that time frame and makes a table. Now I need another query that looks at the dates the user had entered and gets all the records from the week before the user's dates. This query would also be a table query, but separate from the first one.

If anyone at all is able to help me out, I will be deeply impressed and eternally grateful! :)

Thanks,
Chris C.

View 12 Replies View Related

Having A Hard Time With LIKE Operator

Sep 3, 2005

I want to create a query that extract rows that has a specific word.

i.e.

select * fro table where field like "*ART*"

however it should not retrieve "DART" or "ARTI"

i tried using the following [!a-z] and * like this:

SELECT * from DLs where DLName like "*[!a-z]ART" or DLName like "*[!a-z]ART[!a-z]*" or DLName like "ART[!a-r,s,!t-z]*" or DLName like "ART"

it is very long and complicated - cant i cover it all with one like ?

Also the fact that i also want it to get ARTS (i dont know how to say !a-z expect 's')

Thanx in advance

View 2 Replies View Related

Help With A Query... Hard To Explain

Mar 29, 2008

Hi all!, i would really appriciate it if you could help me out. I have this complex query... in one table i have dates and costs associated that show when fuel was put into the system

such as:
1/1/2008 -- $200
1/20/2008 - $100
1/25/2008 - $150

I then have another table that has data when fuel was taken out of the system
such as:
1/2/2008 -- ($50)
1/3/2008 -- ($20)
1/4/2008 -- ($10)

what i need is a query that is able to show a running tab on the fuel tank and how much fuel is in it...

so for example if it could spit out a result such as
1/1/2008 -- $200
1/2/2008 -- $150
1/3/2008 -- $130
1/4/2008 -- $120

If this is convoluted i can upload a little database..

Thanks! (Here is the current query i am using but its not working right.

SELECT DatePart("yyyy",[purchase_Date]) AS AYear, DatePart("m",[Purchase_Date]) AS AMonth, DatePart("d",[Purchase_Date]) AS ADay, DSum("gallons_purchased","purchase_fuel_tbl","DatePart('d', [purchase_Date])<=" & [ADay] & " And DatePart('m',
[purchase_Date])<=" & [AMonth] & " And DatePart('yyyy',
[purchase_Date])<=" & [AYear] & "") AS RunTot, fuel_use_tbl.fuel_date, fuel_use_tbl.external_ID, fuel_use_tbl.gallons, [RunTot]-[fuel_use_tbl].[gallons] AS cur_Value
FROM (tank_tbl RIGHT JOIN purchase_fuel_tbl ON tank_tbl.tank_ID = purchase_fuel_tbl.tank_ID) LEFT JOIN fuel_use_tbl ON tank_tbl.tank_ID = fuel_use_tbl.tank_ID
GROUP BY DatePart("yyyy",[purchase_Date]), DatePart("m",[Purchase_Date]), DatePart("d",[Purchase_Date]), fuel_use_tbl.fuel_date, fuel_use_tbl.external_ID, fuel_use_tbl.gallons
ORDER BY DatePart("yyyy",[purchase_Date]), DatePart("m",[Purchase_Date]), DatePart("d",[Purchase_Date]);

View 14 Replies View Related

Unique Hard Drive Serial

Dec 8, 2005

I have seen some API that gets the serial of the hard drive, but this information is not unique and changes when the volume is formated.
Does any one know of a way to return the orignal manufucture's information/serial which is unique(GUID) to the volume.
Any Idea will be highly appreciated.

View 6 Replies View Related

Two Versions Of Access On My Hard Drive

Nov 28, 2006

Would having Microsoft Access 2002 and 2003 on my hard drive cause me to have error with my code?

View 4 Replies View Related

Easy Question, But Hard To Figure It Out Lol

May 9, 2005

Hey guys,

this may seem unprofessional but anyway..

does anyone know how to DELETE one or more realtionships ?? :o

View 6 Replies View Related

Hard Links In Split Database

Oct 11, 2004

I have a split database on the network, but I believe it contains hard links (i.e. H:path odb). So, if others use it, if they don't have their H drive mapped the same way I do, they'll get errors. How can I fix this so that it maps to the full path (i.e. \path odb)?

View 1 Replies View Related

Saving To External Hard Drive

Sep 30, 2014

I've saved my Access files (as well as my Word files) to an external hard drive. I can open any Word doc from the hard drive, but when I try to open an Access file, it gives me the following error message: "can't find Language DLL msain.dll". What does that mean, and how can I fix it so that I can open an Access file from the hard drive?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved