General :: Referring To A Field That Is Not In A Form

Dec 3, 2012

I would like to know if it is possible to refer to a field even tho it is not in a form, i.e.,

PHP Code:

strSql = "UPDATE tblItems " & _ "SET StockQTY = ([StockQTY]+1) " & _ "WHERE ItemsID = " & [ItemsID] & "" 

The [ItemsID] is actually on the form as a txt box. but i dont really need it there for any other purpose other than the vba above.

In the form i have a field that is in the form as a txt box that has a relationship to the ItemsID. i have attached a image of the relationship.

The field that is in the form is tblOrdersItems.OrdersItemsID and i also have tblItems.Items. so rather than adding another meaningless txt box to the form(ItemsID) i would like to be able to use the relationships to get the correct ItemID ...

View Replies


ADVERTISEMENT

General :: VBA Error Referring Control Field In Subform Using Main Form

Feb 22, 2013

I believe I did this before awhile ago but for some reason I keep getting an error.

I have a Mainform (frmMain) that has a Subform (frmSub). On frmSub I have 2 comboxes (strCom1 & strCom2) one is set to invisible (strCom2.Visible = No).

So using the "On Open Event" of frmMain I want make strCom2 visible if strCom1 = "Read Only". Ofcourse I will also need to place the vba on the On After Update event. Below is what I have so far but doesnt work.

I get Run-time Error 2427 "You enetered an experssion that has no value"

Code:

Private Sub Form_Open(Cancel As Integer)
If Me!frmSub.Form!strCom1.Value = "Read Only" Then
Me!frmSub.Form!strCom2.Visible = True
Else
Me!frmSub.Form!strCom2.Visible = False
End If
End Sub

View 5 Replies View Related

General :: Combobox Not Referring To Correct Field

Oct 22, 2014

I have a form which contains fields from my main table and also has a subform containing a query based on a filtered list of my main table.

I have a combobox on the form to select a name and pass it to the query to filter on.

The list of names is in a table called tblnames which has 2 fields, name and ID. I have linked the ID field on this table to a field called nameid on my main table which is a numeric field (and that allows be to select a name from a list when I enter data into my main table.

The xox is unbound, control source empty and row source set to tblname.

The combobox is only showing a list of numbers (I assume they are the id field from tblname). Yesterday I had the list of names showing and I checked a backup and the only difference I can see is the row source property refers to the name field in tblname but I don't know how I got it there. When I click on the list box for row source I only get offered a list of my objects.

View 10 Replies View Related

General :: Referring To Subform In Navigation Form

Mar 5, 2013

I have an Access 2010 application and I'm having trouble referring to properties in my subform withon a Navigation form. Based on a selection in a Combo Box, I need to change the filter on the subform. The relevant forms are:

Main Navigation Form = frmAdminNav
"Standard" Navigation Subform = NavigationSubForm
My Subform = frmShowInventory

How do I refer to the Filter property on frmShowInventory?

View 2 Replies View Related

General :: List All Open Databases - Referring To Controls On A Form

Jul 17, 2013

Any way to list all currently opened Access databases? It feels like this must be possible by referring to the databases collection, but I just don't know how.

Also, is it possible to refer to controls on a form in one open database from code in another database? (and obviously if so, how?)

View 2 Replies View Related

Delete Fields Referring To Field Number

Aug 5, 2006

I need to trim a lot of tables. Is it possible to delete table fields with reference to the field number instead of field name?

The command 'tblMyTable.Fields.Delete ("FieldName")' takes a string (field name) as input. I rather like to - in a loop - delete say,

Sub DeleteFields()
For i = 40 To 60
tblMyTable.Fields.Delete Field(i) ' Not correct syntax
Next i
End Sub

thh

View 2 Replies View Related

Modules & VBA :: Referring To Calculated Field In A Recordset

Nov 22, 2014

I am trying to use a calculated field in a recordset but I am having problem with the script trying to compile.

my record set is

Set rstPrice = db.OpenRecordset("SELECT Period_desc, Price, Round(Price/7,2) AS Daily_rate FROM qryPropertyPriceList WHERE [Our ref] = '" & rstProp![Our Ref] & "' And [Year] = " & rstProp![Next year price base] & " Order By Sequence", dbOpenSnapshot)

The calculated filed I have added in is Round(Price/7,2) AS Daily_rate

If I let it run just with this it runs fine.

and then I try to use this calculated field:

Do Until rstPrice.EOF
Temp = Temp & rstHTML!html35 & rstPrice!Period_desc & rstHTML!html36 & rstPrice![Price] & "-" & rstPrice![Daily_rate] & rstHTML!html37
rstPrice.MoveNext
Loop
rstPrice.Close ' Tidy up
Set rstPrice = Nothing

They it stops running and it all seems to be because of the Daily_rate field

View 11 Replies View Related

Reports :: Report Keeps Referring To Wrong Field?

Sep 30, 2013

I have a query[view] where I have six employee numbers, I left join these to an Employee table to retreive the names.

I've created a report that uses this query/view as its source. For some reason my report keeps making all six name fields refer to the same control source Employee.Name and not Employee_1.Name, Employee_2.Name, Employee_3.Name,.... respectively.

In design view everything looks fine but when I switch to report view the switch happens, it displays the same name in all fields. When I switch back to design view all of the fields have changed to the same control source.

why this is happening? My tables are in a SQL server.

View 10 Replies View Related

Tables :: Running If Statement On Records - Referring To Table Field

Apr 19, 2013

I'm trying to run an if statment, on the records in a field (called "Current_Month"), in an existing table called ""Current_Months_Lag1_Data".

The IF statements work fine - and simply perform a different action for different data in "Current_Month".

I am having problems referring to "Current_Month", where I keep getting 424 (Object required) and 3420 (Object invalid) error messages, on the last line of code.

I have defined & identified the table in which the field is located, yet somehow cannot identify the field within that table. (I've already tried searching the web for similar problems under error messages 424 & 3420).

Function LAG_Forecast_03()
Dim dbs As Database
Set dbs = CurrentDb
Dim Tbl As TableDef
Set Tbl = CurrentDb.TableDefs("Current_Months_Lag1_Data")
Dim FLD As Field
Set FLD = Tbl![Current_Month]

View 6 Replies View Related

Forms :: Referring A Form Inside A Form Using Access 2007

Mar 10, 2013

I have a Form called X which contains a subform called Y. I have placed this Form inside another form called Z.

There is a CommandButton which when clicked must refer to the Subform. How do I do this?

I tried using [Z]![X]!Y, Form_Z.Form_X.Y, [Z]![X].Y but it throws an error saying the form name has been misspelled ...

View 4 Replies View Related

Referring To Form By Using Its Index Number

Aug 23, 2006

How can I refer to a form by using its index number? Also how can I retrieve an index number of a form?

(I'm opening multiple instances of the same form and read that the only way to refer to those instances is by using their index number. I found some solutions that use hWnd as well but I can't get any further support on it as far as referring to a form by using the window handle so I'm trying to capture and then use the index number)

View 4 Replies View Related

Modules & VBA :: Referring To Tab Control On Sub Form

Jun 9, 2013

I have the following setup:

A main form - named [formMain]
On [formMain] I have a tab control - named [tabMain]
[tabMain] has 3 pages named [pageOne], [pageTwo] and [pageThree].
On [pageThree] I have created a subform named [formSub].
On [formSub] there is a tab control named [tabSub].

Now what I would like is to make [tabSub] (in)visible if the user switches from [pageOne] or [pageTwo] to [pageThree].

Code:
Sub tabMain_Change()

How do I refer to [tabSub] from within this subroutine? I am trying something like:

Code:

Forms![formMain]![pageThree].Form![tabSub].Visible = False

but it is not working. What should be the correct way?

View 2 Replies View Related

Forms :: Referring To Form And Subform Combo Box

Jul 21, 2014

I have a form named frmMain that contains five buttons that lead to subforms, one of which is named frmDeceased.

In frmDeceased, I needed to create a combo box that relied on selections from the combo box before it. I was able to do this successfully in frmDeceased, but then today when I opened the database and opened frmMain, I realized that the query fails when frmDeceased is opened via frmMain. It works perfectly if I just open frmDeceased directly.

The first combo box is ROHE and the second is Iwi (which is dependent on the Rohe selected).

The query for Iwi has this criteria: Forms!frmDeceased!cbo_ROHE

When I open frmDeceased through frmMain, I get the 'enter parameter value' message showing "Forms!frmDeceased!cbo_ROHE".

I tried changing this query to: Forms!frmMain!frmDeceased!cbo_ROHE, but it didn't work.

View 14 Replies View Related

Forms :: Textbox On Main Form Referring To Subform Control

Aug 14, 2014

I have a form with a subform which resides in a tabbed control. In that subform, I have a textbox in the footer that sums values in the detail section of the subform.

I have a textbox on my main form that should display the same data that is in my subform footer textbox, but it is giving me the #name? error.

This is the expression in my subform footer textbox (which returns the correct result):

TxtSubtotalHQPCalc -
=Sum([ActualHQPCalc])

And the expression in my main form textbox (which returns #name?):

txtActualHQPValue -
=([subfrmHQPProject].[Form]![TxtSubtotalHQPCalc])

I have verified that my subform name and textbox names are all accurate. This is very frustrating because I am using this exact same method in a different database with no problems!

View 3 Replies View Related

Frequent Error In Referring / Linking Textbox In Subform From Text Box Within Main Form

Apr 17, 2013

Go to frmInvoice, and you'll see a Net Total box (txtNetTotal) . It's control source is linked to a textbox in the subform fsubInvoiceDetails2 called txtStocktotal. It basically just pulls up all the costs associated with that InvoiceID.

The reference mechanism is as follows: =[fsubInvoiceDetails2].[Form]![txtStockTotal].Now...sometimes this works and sometimes it doesn't! Sometimes i've had to use: =forms!fsubInvoiceDetails2!txtStockTotal.

It seems to be very temperamental at times and i'm not fully confident if this can be explained.By way of note, I use express builder normally to input these statements: I go to Forms > ALL FORMS > fsubInvoiceDetails2 > txtstocktotal.

View 2 Replies View Related

General :: Making A Form Button That Will Act As TAB- Move From Field To Field In The Form?

Jun 12, 2013

I made a form for use in touch screen app. I would like to make a form button that will act as TAB- move from field to field in the form.

View 4 Replies View Related

General :: Update Main Form Field Value After Updating Field Value In SubForm?

Feb 12, 2015

I have a main form and a subform.

Both forms have the field called JobID in common.

Both forms have a field called JobStatus.

Any easiest solution so that After I Update the field called JobStatus in the subform, it changes the field called JobStatus in the main form to the value which was selected from the subform?.

View 3 Replies View Related

General :: 2 Field Look Up To Auto Fill Another Field On Form

Jan 2, 2013

Is it possible to look up 2 field to auto fill another field on my form?

Field 1 is "RiskLetter" this is autofill with "Risk" is user input.

I need to lookup RiskLetter and Risk and autofill from "Number" field. This to stop incorrect data being inputted.

So I need to look at the "Risk" & "RiskLetter" to come up with a "Number"

Would it be possible to use a Dlookup to look at RiskLetter and Risk to give me the score.

View 14 Replies View Related

General :: Field Name On Top Of Form

Jul 26, 2012

I have a form that holds student information at the top of the form I'd like it to display the name of the student as I am scrolling through records.

So in other words, I have my fields First Name and Last Name on my form. But as I am going through records i want the full name of the student to display on top of the form as well as in the next box.

How would i do this?

View 3 Replies View Related

Referring To A Combobox Value

Jan 4, 2005

hiya..how do i refer to a combobox value from a criteria in a query??
i.e. criteria for a field in query = combobox value in a certain form

View 2 Replies View Related

General :: Display PDF From OLE Field On Form

Feb 4, 2014

I'm working on an existing 2010 database that has a table that stores PDF's in an OLE field. The boss wants to be able to see the PDF on a form along with the other fields in the database. He doesn't want the pdf to open up in a separate window in Adobe PDF viewer. He doesn't want to have to switch between 2 windows because he's comparing data from the other fields in the record to what's on the PDF. He doesn't have dual monitors and doesn't want that either.

when I put the PDF field on a form all I get is an ICON that has to be double clicked on to open but I need it to display the pdf or at leas part of the PDF so he can scroll down to view the whole pdf. I thought about using a subform or tabs and putting a web browser control to display the pdf. I've seen examples of how to set a web browser control URL when the pdf is in an attachment field but I haven't been able to find any examples of how to view the pdf in a web browser control or any code to actually show the pdf on the form from an OLE field.

I know storing the PDF in an attachment field is the best way to do this and I've let the boss know. My only task is to display it on a form and not to redesign the database.

View 1 Replies View Related

If Statments And Referring To Other Tables

Sep 25, 2007

I am new to access and am having troubles figuring out if statements. I want an if statement in a table that says if column 1 = "whatever" then column 2 = "YAY" else column 2 = "NO".

How would I apply this to a table?

Also I have a table that has one column it is a list of codes. In another table there are 2 columns column 1 has a code i want column 2 to say if column 1 code is found in the list of codes from the other column the put "MATCH FOUND"

Thanks,
Mike

View 12 Replies View Related

Referring To The Data In Rows Below

Sep 27, 2007

Column A Column B Column C Column D
1*010101001000000 CF 5
010101002000000 RF
010101002000000 RF
010101029000000 CU
1*010101001000000 CF 10
010101351010000 RF
2*010101354000000 CF 11
2*010101354000000 CF 13
010101358000000 CY
1*010101001000000 CF 5
010401328100000 CF


NOTE in the actual data won't be there it is just to show you what I am referring to.

Is there any way in another column in a query to say if Column A repeats itself somewhere else in Column A AND if those two that are repeated both have a "CF" code add column C (which is just an amount for each number)

So for example in this data there are 2 numbers that repeat themself that have CF codes. For these I would need to total them in column D for the first number resulting in:


Column A Column B Column C Column D
1*010101001000000 CF 5 20
010101002000000 RF
010101002000000 RF
010101029000000 CU
1*010101001000000 CF 10
010101351010000 RF
2*010101354000000 CF 11 23
2*010101354000000 CF 13
010101358000000 CY
1*010101001000000 CF 5
010401328100000 CF


Any ideas?

Thanks,
Mike

View 14 Replies View Related

Referring To Columns In A Combo Box ?

Jan 26, 2006

Hello, I am using an IIF statement in my SQL criteria, and was wondering "if" it was still possible to reference a column within a combo box... here is one iif statement

Like IIf(IsNull([Forms]![fSampleSearch]![cboCustomerName]),"*",[Forms]![fSampleSearch]![cboCustomerName])

I want to refer to the third column of cboCustomerName... How would I do this ?

View 8 Replies View Related

Label Name Referring To Subform

Jul 3, 2006

Just a quick question, I can't seem to get this right (as usual :confused: )

I have a form and I want the label in the header to display the text from a field in a related subform. I have tried the following syntax to no avail:
=[Forms]![sfrmCompanyName]![LastName]

Any suggestions

Thanks in advance

Nicolas

View 2 Replies View Related

Referring To A Subform Control

Nov 15, 2004

I know how to refer to a control on a form by using [forms]![formname]![controlname], but can anyone help with referring to a subform.

I have a subform called subPrograms, on which is a combo box whose contents need to be filtered depending on the selection from another combo box on the main form.

The combo box on the main form is cboDivisions.
The combo box on the subform is cboPurchasers
Main form is called frmMain
Subform is called subPrograms

The user is supposed to select a Division, and then depending on that selection the contents of cboPurchasers will change to only show those that are within that same division.

I would also like to know how to update the cboPurchasers when the cboDivision has been selected? Can someon help?

I hope that this is enough info.

View 2 Replies View Related







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