What does this code mean?

Hi, I'm analyzing a program made with MS Access. It has a whole bunch of tables and queries already made, and a form with lots of code behind it. I'm looking through and I'm not sure what the following means:

With CurrentDb
.QueryDefs("qry_cur_pier").SQL = _
" SELECT DISTINCT RE.AIRPORT_RESOURCE_NAME,
RE.AIRPORT_RESOURCE_KEY " & _
" FROM qry_cur_resource AS RE " & _
" WHERE RE.AIRPORT_RESOURCE_CODE = 'PIER';"

qry_cur_pier appears to be an already existing query. AIRPORT_RESOURCE_NAME and AIRPORT_RESOURCE_KEY are fields in that query. AIRPORT_RESOURCE_CODE is not in the query though. What does the RE. and the AS RE do here? Thanks in advance.


Post your answer or comment

comments powered by Disqus
Im sorry for this post but what does this transparent square mean? Its driving me mad?



Thanks
Joe

I read this line a lot in posts and I dont fully understand it.
Quote: The first problem I see is that maybe you have a normalization issue. I'm as normal as they come, unless you ask my mom, she says I'm an alien.

What does this mean to databases?

I am getting very good at deciphering VBA code!!! I have one question that google isn't much help with in the code it shows:

Code: DoEvents Me.Form.Refresh Exit_Form_Current: Exit Sub Err_Form_Current: Select Case Err.Number Case 0 Resume Next Case Else Call gsErrorHandler(Err, Application.CurrentObjectName, Application.CurrentObjectType, "Form_Current") End Select Resume Exit_Form_Current End Sub And when I Debug, it is showing Sub or Function not defined on the Call gsErrorHandler. Is this a macro or something that was written by the previous code writer or what in the world is that?

Probably a stupid question, but.....

Given: rScheduled is a field in the "Tests" table, "classes" is a seperate table and "cDate" is a field in the "classes" table.

What does this mean in a query?
rScheduled:[classes]![cDate]


Thanks

Hello friends

How are you

Please I need help in Union Queries
what does this code mean
"SELECT [Query_buy] ,Type.[Query_buy].Sum0 ,no AS InQuin , "Return" as Description From [Query_buy]"

I need to make combined report shows the reteurnd items.
I hope that my words are enough clear

Thank you all

I've got the following bit of code on a db that looks up an e-mail address from a table:

	Code:
	strSql = "SELECT [Work e-mail] FROM [Product Managers] WHERE Name='" & [Forms]![Project Main]![Product Manager] & "';"
MsgBox strSql

' Open pointer to current database
    Set dbs = CurrentDb()
    
' Create recordset based on SQL
    Set rst = dbs.OpenRecordset(strSql)
    
If Nz(rst![work e-mail], "") = "" Then
  strEmailAddress = "montera@att.com"
  TestInput = "No PM"
Else
  strEmailAddress = rst![work e-mail]
End If

This works as is, but now I need to modify it to use it in another part of the db and I do not know how to do it right.

If I know the e-mail addresses I want to e-mail, I do not need to do the sql, right? If that is the case, what do I set this part of the code to:

	Code:
	   Set rst = dbs.OpenRecordset(strSql)

Then, what does this piece of code do?

	Code:
	If Nz(rst![work e-mail], "") = "" Then
  strEmailAddress = "montera@att.com"
  TestInput = "No PM"
Else
  strEmailAddress = rst![work e-mail]
End If

mafhobb

Hallo,

I am new to access please could anyone tell me what does this two line of codes mean;


Set qDF = cON.CreateQueryDef("", strSQL)

Set rST1 = qDF.OpenRecordset()

Thanks

I am testing an Access database, where there is a combo box on the form. The OnChange event for the Combo box is set to =[refresh]. What does this mean?

On another note, the form itself has a Commit button, with the following code in the OnClick event:
If Me.Dirty = False Then Exit Sub

Me.RefreshIs this button necessary? It appears to work fine without it, but I'm wondering if I'm missing something.

Thanks

I'm trying to break down my Tables into smaller Tables with assigning & relating Tables by ID Fields. This whole relational concept I just can't fully get under my belt & is frustrating regardless how many times I watch videos on this concept. I know that if I could only understand everything & the 3-rules in creating relational tables I could go long ways ...?

Anyway, as I said I tend to relate my tables according to ID fields, but when I attempt to create queries on more then one "relted" table often times I get this message, "No unique index found for the referenced field of the primary table." What does it mean?

I have a data entry form and then press add. this is what I get:

The changes you requested were not successful. You can not create duplicate values in the index, primary key or relationship. Change data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

My primary key is based on the name field which it allows me to input. The problem is occurring with the various phone number fields that I have. if I leave them blank then no problem but if I fill several in then boom. Sorry so long but wanted to get it clear.

Hayley,
I have tried using your code on my form, but I get an error that says: "Syntax error(missing operator) in query expression '[txtLineID] = 3PW4000ExMH0+00A-13+00' ".


What does this error mean?

(That long string is a concatenated field I am using as my PK)


Any help would be appreciated. The code I put in is as follows:


Private Sub cmdLaterals_Click()

On Error GoTo Err_cmdLaterals_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmLaterals"
stLinkCriteria = "[txtLineID] =" & Me![MHLineID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdLaterals_Click:
Exit Sub

Err_cmdLaterals_Click:
MsgBox err.Description
Resume Exit_cmdLaterals_Click

End Sub

Hi,

Our Contacts database holds records relating to individual clients. As these clients are visited in their homes, I have put a "Lone Worker Caution" yes/no field on the form to alert staff of potential risks prior to visiting.

To have a more visual signal to staff, I have placed a label (label202) on the form with it's visibility properties set to NO. With a lot of help from other forum users, I have put the following code behind the yes/no check-box, to activate the label and cause it to "flash" in red & black colours:

Private Sub LoneWorkerCaution__AfterUpdate()
If Me.LoneWorkerCaution = True Then
Me.Label202.Visible = True
End If
If Me.LoneWorkerCaution = False Then
Me.Label202.Visible = False

End If

End Sub

Private Sub Form_Contacts()

If Me.LoneWorkerCaution = True Then
Me.Label202.Visible = True
End If
If Me.LoneWorkerCaution = False Then
Me.Label202.Visible = False
End If
Me.TimerInterval = 300
Me.Label202.ForeColor = vbBlack



End Sub

Private Sub Form_Timer()
With Me.Label202
.ForeColor = (IIf(.ForeColor = vbRed, vbBlack, vbRed))
End With


End Sub

Everytime I click the yes/no check box to activate the warning message, VBA opens up with the message "Compile Error: Method or Data Member Not Found".

What does this message mean? What do I have to do (in Plain English please, I'm new at this!) to fix it?

What follows is a task I'm supposed to do but the problem is I don't know what it is I'm supposed to do.
...
The management of My Little Bookshop have asked you to help them automate some of their
regular tasks.
These tasks require you to create Templates for their Word Processing and Spreadsheet operations.
Additionally you need to create several Macros to automatically perform a few routine tasks.
You may use either Microsoft Office or OpenOfficeOrg applications to perform these tasks.
1. Using your word Processing Program:
a) Create a template that has your company logo at the top left corner and store address at the
top right, a generic salutation, a space for the body of the letter and a closing salutation with
a date field.
b) Create a template similar to the one above except that the salutation is to have a “fillin” field
for the addressee and the body is also to be a “fillin” field.
The closing salutation is to be a series of “fillin” fields for the name of the person and their
position and an autoupadting date field.
c) Using the template from part b to create a mail merge main document that has the name and
address of the customer below the logo, their name in the salutation, and the following fields
in the body of the letter advising them of the arrival of their ordered books and the balance
owing
Name of Book
Final Price
Balance Owing
d) Create buttons on a toolbar to easily access these documents.
2. Using your Spreadsheet Program:
Create a macro to prepare a weekly sales report – the report to include the following as a
minimum:
Company Logo in cell A1
Company address in A6
Title “Week ending:” in A2
Date of the Friday of the week in B2
From A4 the Name of the book, B4 type of book, C4 Quantity sold, D4 Value of sales
a graph showing the sales
a list of the top 5 sellers
This data to come from your database
3. Using the Database program:
Create a “switchboard” or opening menu that displays when the database is opened.
This menu to have buttons that access and run macros to perform the following tasks:
Display a list of books by a specific author [parameter query]
Move books that are discontinued to a Discontinued table then delete them from the main table
Print a list of books that are out of stock
Export the list to a text file for manipulation elsewhere
...
I can do the Mail merge and Excel parts but I'm completly stuck on the last bit which looks like an alien language to me. What does this all mean? Can someone explain the last bit to me or tell me what I have to do? Any help at all would be amazing.

Hi there,

I have a problem with an SQL query, which should combine data out of three different tables (tblTransactions, tblTradedSecurities, tblStopps, tblQuotes) using a combination of Inner-joins and sub-queries. However, I get an error message, which tells me that this is an improper SQL query and that Access rather expects a "Delete, Insert, Select or Update"... what does this exactly mean, what is wrong with my query?


	Code:
	SELECT X.Ticker, S.Name, sum(X.Qty) AS TotQty, X.qCl, (SELECT Top 1 [Stop] FROM [tblStopps] WHERE [Date]

I get an error that says: "Syntax error(missing operator) in query expression '[txtLineID] = 3PW4000ExMH0+00A-13+00' ".


What does this error mean?

(That long string is a concatenated field I am using as my PK)


Any help would be appreciated. The code I put in is as follows:


Private Sub cmdLaterals_Click()

On Error GoTo Err_cmdLaterals_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmLaterals"
stLinkCriteria = "[txtLineID] =" & Me![MHLineID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdLaterals_Click:
Exit Sub

Err_cmdLaterals_Click:
MsgBox err.Description
Resume Exit_cmdLaterals_Click

End Sub

I have the following code in the click event of my button,

	Code:
	Dim strCriteria As String
strCriteria = "[1stApproval]='-1'"
DoCmd.OpenForm "FrmLookupRecords", acNormal, , strCriteria

However when I click the button, there was an error that says,
Quote: The OpenForm action was cancelled. You used a method of the DoCmd object to carry out an action in Visual Basic, but then clicked Cancel in a dialog box. For example, you used the Close method to close a changed form, then clicked Cancel in the dialog box that asks if you want to save the changes you made to the form What does this error mean? I want to open a form that only shows approved records and the column "1stApproval" is a Yes/No field. Thanks for any help!

A user yesterday informed me I need a me.requery. I have a form with tabbed pages. First page I complete details of clients - second page goes into more detail. On second page I have a combo box listing all clients in alpha order. I want to get the new client I have just completd on first page into that combo box without having to close and re-open form. Does this code go against combo box, or page? Is there anything I need to add to this code, like form name? Have tried in various ways without success.

Our Contacts database holds records relating to individual clients. As these clients are visited in their homes, I have put a "Lone Worker Caution" yes/no field on the form to alert staff of potential risks prior to visiting.

To have a more visual signal to staff, I have placed a label (label202) on the form with it's visibility properties set to NO. With a lot of help from other forum users, I have put the following code behind the yes/no check-box, to activate the label and cause it to "flash" in red & black colours:

Private Sub LoneWorkerCaution__AfterUpdate()
If Me.LoneWorkerCaution = True Then
Me.Label202.Visible = True
End If
If Me.LoneWorkerCaution = False Then
Me.Label202.Visible = False

End If

End Sub

Private Sub Form_Contacts()

If Me.LoneWorkerCaution = True Then
Me.Label202.Visible = True
End If
If Me.LoneWorkerCaution = False Then
Me.Label202.Visible = False
End If
Me.TimerInterval = 300
Me.Label202.ForeColor = vbBlack



End Sub

Private Sub Form_Timer()
With Me.Label202
.ForeColor = (IIf(.ForeColor = vbRed, vbBlack, vbRed))
End With


End Sub

Everytime I click the yes/no check box to activate the warning message, VBA opens up with the message "Compile Error: Method or Data Member Not Found".

What does this message mean? What do I have to do (in Plain English please, I'm new at this!) to fix it?

Thanks.

Hi

I'm relatively new to access and i've just designed a database using some vba code. Sometimes when i'm using a form an error box comes up saying run time error 7878. What does this error mean?
Its not causing a major functionality issue but it does make it a lot easier for users to get to the coding through the debug button which I don't want to happen.

hey, here is my setup

i have a GENERAL table with medical patients basic information.
then i have multiple other tables (medications, visits, diagnosis, referring doctors), all linked by HistNum.

i have a form that opens a report filtered to a single patient and is going to display all of these tables. there is the main information on top, and then a subreport for the reffering doctor (this is all i have so far)

in the subreports properties, i have the Master/Child links set correctly by HistNum but nothing appears.. however, if i change it to ID, which is an irrelevant field in both tables, information does appear..

also, in an earlier thread where i ask about how to eliminate the whitespace left behind from cells of the table that are missing, i was told to "set the height of the controls to a negligible height and the can grow to yes", then the missing lines should be eliminated. for this, do all my fields i want displayed have to be part of 1 big text box, or multiple? (right now i use multiple)

what does this person mean by a negligible height?

heres a screenshot of the report

Cannot Add Records "join key of table 'Publishers_Contact_Type' not in recordeset


What does this error mean and how to I resolve the problem?



Any and All Help would be tremendously appreciated!!! THANKS

hello,

i have table1(id1 PK) and table2(id2PK, a1, a2)

i want a1 and a2 to be foreign keys for id1 (with cascade on update & delete). making a1 foreign key works fine. when trying to make a2 foreign key as well, a 3rd table (table2_1) appears in the relationships window (but not in the db).

what does this behaviour mean?

thanks

I am trying to close the linked subform from a main form using a macro. The macro simply closes the two forms. I am getting the error message you see in the attached jpeg. What does this error mean? And if I can't close the linked form this way would DoCmd do it? What would be the syntax?

I have a tabbed form in my database. The top section of the form contains the customer information. Then the tabbed section contains information regarding different agreements my company has with the customer. The information on each of the tabs is housed in a different table. This database has been up and running fine for a couple months. I have just started getting a weird error message, and I cannot figure out what it means. The error message reads "The object doesn't contain the Automation object 'Main Table.' You tried to run a visual basic procedure to set a property or method for an object. However, the component doesn't make the property or method available for Automation operations. Check the component's documentation for information on the properties and methods it makes available for Automation operations." The only thing that I have done to this database in the last couple weeks is copy the structure of a couple tables, because my manager wants "Archive" tables in the same database. I can add a record to the query behind my form, but I cannot add a record to my form without getting this message. What does this message mean? What do I need to do to correct it?


Not finding an answer? Try a Google search.