Retrieve name of current Sub or Function


Is there a function, or an object property, which will return the name of the Sub routine or Function that is currently processing
Posted On: Monday 22nd of October 2012 05:57:34 AM Total Views:  266
View Complete with Replies

RELATED TOPICS OF Microsoft Access PROGRAMMING LANGUAGE




Variable table name? need some urgent help!

hey is it possible to have a variable table name; this is my scenario: i have four category of products, which i am selecting using a pull down menu. depending upon which the user chooses, a particular table of database shud be searched. this is what i have been tryn: tablename=CStr(Request.Form("category")) strq="Select * from '&tablename&' where (model='" & CStr(Request.Form("model")) & "') ;" but im getn the error: incomplete query. been tryn double and single quotes. just not getn it. please help! have to submit my project morrow!!!!!
VIEWS ON THIS POST

149

Posted on:

Thursday 18th October 2012
View Replies!

Concatenate name fields to create login name


VIEWS ON THIS POST

196

Posted on:

Thursday 18th October 2012
View Replies!

Get Excel worksheet names from Access

, I need to pull data from specific worksheets in Excel from Access. I have code to get the data from a worksheet, but the sheets themselves have dynamic names that I will not know until runtime. There is one worksheet called "Template" that is consistent. I will need data from every sheet after that one, regardless of its name. So basically I need to find which sheet "Template" is, find all the worksheets after that one and get their names. Then I can use my existing code to loop through each existing sheet (by name) and pull the data I need. I'm thinking this is somewhat simple--there has to be some command to find all the worksheet names, but I haven't found it yet.
VIEWS ON THIS POST

96

Posted on:

Thursday 18th October 2012
View Replies!

Can query return named parts and sum of shipped if table has no listing?

I am trying to create a query that will return 5 given part numbers and the quantity sold (via our ship date), given a Begin Date and an End Date. I have the query working so it accurately given the correct sum of sold items, but if no items were sold in this time, there is no listing. Is there a way to get the part number to list with a number shipped set to zero I've tried multiple variations of Nz() and IFF() functions yet it still only returns a list of the items if an item has been shipped. I simplified the code below. Any suggestions are greatly appreciated! Thank you in advance. Code: SELECT [Invoice Detail].PartNo, Inventory.ProductDesc, Nz(Sum(Nz([Invoice Detail].[QtyShipped],0)),0) AS Shipped FROM (Invoices INNER JOIN [Invoice Detail] ON Invoices.InvNo = [Invoice Detail].InvNo) INNER JOIN Inventory ON [Invoice Detail].PartNo = Inventory.PartNo WHERE ((([Invoice Detail].UnitCost)>0) AND ((Invoices.DateShip) Between [Begin Date] And [End Date])) GROUP BY [Invoice Detail].PartNo, Inventory.ProductDesc HAVING ((([Invoice Detail].PartNo)="A" Or ([Invoice Detail].PartNo)="B" Or ([Invoice Detail].PartNo)="C" Or ([Invoice Detail].PartNo)="D" Or ([Invoice Detail].PartNo)="E"));
VIEWS ON THIS POST

145

Posted on:

Monday 22nd October 2012
View Replies!

Multiple field names in Shell

Using Access 2003, Win 7. I'm trying to use the Shell function to open a specific XML file using Oxygen. The full Oxygen path comes from a field named "txtAppPath" on a form named "frmDefaults". The full path to the file comes from a field on the current form named "txtPath". The name of the file comes from a field on the current form named "cboSourceDoc". When I use literal values for the application and file paths, it works: Shell "C:\Program Files (x86)\Oxygen XML Editor 12\author.exe C:\_topics\" & Me.cboSourceDoc, vbNormalFocus When I try to substitute the field names for either of these literal strings, I get an immediate "File Not Found" message. I've tried every combination I can think of. Can Shell do what I'm trying to do I'd appreciate any hints on the syntax, please.
VIEWS ON THIS POST

107

Posted on:

Monday 22nd October 2012
View Replies!

Getting the name of a chart series name

I'm using Access 2003. I have a form containing four check boxes and a chart. I use some VBA code to update the chart based on the check box values. Sometimes one check box is selected, sometimes two and so on. Depending on how many check boxes are selected the colours in my line chart change for each series. I want to keep the colour consistent for each series. With this in mind, Im trying to add some code that runs through each of the four chart series names and changes the colours to a specified colour but I'm not sure how to refer to the series name in code. I have some code as follows: Code: For j = 1 To chartSevenDay.SeriesCollection.Count if chartSevenDay.SeriesCollection(j).seriesname = "x" then chartSevenDay.SeriesCollectio(j).DataLabels.Line.Color = 4 endif Next The bits in bold are a guess (and are wrong). Please can you correct me
VIEWS ON THIS POST

84

Posted on:

Monday 22nd October 2012
View Replies!

What name is THE name?

What name is the name On a form, in design view, the label and the control have different names. Which is the name from a VBA reference standpoint What if the property sheet name is different from all the others For example: Label Name: Last TextBox: Last Name Property Sheet for the text box: Surname.
VIEWS ON THIS POST

120

Posted on:

Monday 22nd October 2012
View Replies!

Combo gives error "...database engine doesn' recognize '...' as a valid field name...

Hi I used to have 2 forms on my database that did basically the same thing but from different points of view. One of them would let me see visits in the database by selecting a student. The other one would let me see visits in the database by selecting an advisor. So we needed to put these 2 forms into one, so when the user selected a student it would show the visits for this student or when the user selected an advisor it would show the visits for this advisor. So what I did was I put combo boxes in the "see visits by advisor" form with the intention of having users select a student there as well as an advisor. Problem is when I select an advisor it work fine and shows what it needs to show. However when I select a student it gives me this error: "The microsoft office access database engine does not recognize 'ID' as a valid field name or expression" this is the code that i have on the onclick event of the combo: Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[ID] LIKE '" & Me![Combo16] & "'" If Not rs.BOF Then Me.Bookmark = rs.Bookmark this is the same code that i have on the combo to select an advisor, the only difference is instead of having [ID] i have [Advisor_ID] and it works. I don't know why the one to show a student won't work. Can anyone give me some thoughts on this
VIEWS ON THIS POST

121

Posted on:

Monday 22nd October 2012
View Replies!

Use usernames to update information in reports

Good morning to you all. I have created a database for my company to monitor all of our cases. Within this database i use reports to create standard letters for our housing advisers to send out to clients and contractor. What i need to do now is to find an easy way to update the name at the bottom of the letters. For example if John Doe sent a letter it would automatically put his name at the bottom but if Jane Doe sent one it would be hers. After consulting with other members of staff they suggested individual usernames that they signed in on and the letters would update to reflect the user currently signed in. I wasnt sure if this was possible but said i would look into it. However a search on the internet did not yeild any results. So i am asking you good people if there is any possible way to achieve my goal Do not worry if my aim is impossible as i have a backup plan of creating a drop down box will all the staff names. WHich would be much easier to create but to make the staffs lives easier i will attempt the user name idea. Thankyou for your time
VIEWS ON THIS POST

273

Posted on:

Monday 22nd October 2012
View Replies!

Queries not recognizing new table field name

I've just changed a field name on a table to correct a small problem. In doing so, I corrected the problem, but now have a new problem as a direct result of the change. The new problem involves a number of queries that gather information from the table. I've gone through the queries, and it appears that the new table field name is present in all, having been updated by some internal Access function. Yet when the queries run, they prompt the user for information under the old table field name. The process was automatic before, not requiring any input from the user. I've looked through the design views of all affected queries, even the SQL coding, and all show the new table field name. What could be casusing the system to prompt for data under the old table field name
VIEWS ON THIS POST

138

Posted on:

Monday 22nd October 2012
View Replies!

Changing Object names

I am a new user working on my first Access database. I would like to change some of the object names to make them more clearly indicate what they are. Can I do this without screwing up queries, reports, etc already created using the current names
VIEWS ON THIS POST

77

Posted on:

Monday 22nd October 2012
View Replies!

Report problems:name missing from header

hi, I have a report that has a header,detail. The header is grouped on last name. Whenever I have names that are the same, two Smiths in a row, for example, I only get the first one. THen, I seem to only get partial information in my detail section. I've fooled around with the grouping properties , but I only make it worse. How do I make the second "Smith" appear This must've been happening before, but I didn't notice it.
VIEWS ON THIS POST

114

Posted on:

Monday 22nd October 2012
View Replies!

Saving a named file

what is the correct syntax to string in a variable date here is my current coding [CODE] Set rsDate = CurrentDb.OpenRecordset("qry_Actual_Costs_Thru") strSOPCDate = rsDate.Fields("Fiscal Week") 'need to string the file name with the date ActiveWorkbook.SaveAs Filename:= _ "C:\my folder location\Combined SOPC THIS IS WHERE I NEED THE strSOPCDate.xls" _ , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False CODE] my overall goal is to save a weekly file named "Combined SOPC m/dd/yy" where the m/dd/yy is being pull form strSOPC Date whick pulls from my qry.
VIEWS ON THIS POST

71

Posted on:

Monday 22nd October 2012
View Replies!

Invalid path name

I have very very basic skills in Access and have been attempting to work with a database that a previous employee from my office designed. The other day another person in my office moved the folder on our office network that contains the link to open the database and today when I entered our database and tried to click on one of the forms to enter data it is telling me that the path name for that form cannot be found. How do I edit the path name for a form
VIEWS ON THIS POST

86

Posted on:

Monday 22nd October 2012
View Replies!

Import certain files based on file name

hi i am trying to import a fe files that have a certain portion of the file name tat is the same. Since i don't know the syntax in VB this makes it much more harder. I understand the logic, but writing is a chore. can someone please look at this code and tell me what i am missing Code: Private Sub upload_Click() Dim strfile As String wirds = "D:\RLConverter\upload\" strfile = Dir("wirds & *.csv") ChDir (wirds) Do While Len(strfile) > 0 If Mid(strfile, 1, 5) = Z56203 Then DoCmd.TransferText acImportDelim, "import spec", "data1", strfile, True Kill strfile strfile = Dir End If Loop End Sub
VIEWS ON THIS POST

79

Posted on:

Monday 22nd October 2012
View Replies!

Uploading image name to database

Hi I am trying to simply upload an image to a image folder then take that image name and put it into a access database for retravel at a later date\t I can not work out why I am getting the following error and am going cross eyed with it ... can anyone see where I have gone wrong\t The error: Persits.Upload.1 error '800a0018' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /UploadScript1.asp, line 26 The line of code: Code: File.ToDatabase connection, SQLsmt The whole code: Code:
VIEWS ON THIS POST

111

Posted on:

Monday 22nd October 2012
View Replies!

get username of current user

Hi I have designed a MS Access tool accessed by multiple user. The first screen asks for badge number which is unique for each user. I wanted to do away with that screen. Instead wanted to get the username of the currently logged in user, may be from registry or somewhere. We have Windows XP here. Is there any VBA script for that....Need help!!
VIEWS ON THIS POST

83

Posted on:

Monday 22nd October 2012
View Replies!

Searching by name

I need some assistance in searching for a recorded by employee name with the click of a button. There could be more than one record for each employee name so i need a way that once the records are found they can be displayed to the user ANY help is greatly apprieciated!!!! THANKS
VIEWS ON THIS POST

74

Posted on:

Monday 22nd October 2012
View Replies!

change column names

Can I edit a column nameto show a different name than in my table as a heading
VIEWS ON THIS POST

71

Posted on:

Monday 22nd October 2012
View Replies!

Matching name differences

Hi. I am in the process of loading nursing license numbers into my database. The spreadsheet that I am importing from does not use the exact same names as the ones in my database, i.e. Smith, Deb in my database is Smith, Debora in the spreadsheet and I can't figure out the code or procedure to use to tell the database that these names are actually for the same record. Is it possible to do this and if so, how Thank you! KellyJo
VIEWS ON THIS POST

73

Posted on:

Monday 22nd October 2012
View Replies!