Forms :: Returning Value From A Query To A Form Text Field

Apr 16, 2013

I am using Access 2007. Second, I am using two tables, Inventory and Service Request. Inventory is a list all the Inventory, with has things like location (building & room number), type (desktop, laptop, etc.) and access tag number. Service Request also has Access Tag Number (should link back to Inventory) & date of reported/resolved problem and description of problem/solution.

On my form for Service Request, I have the access tag number as a fill text box, when you double click on that text box, it runs a Query that asks for the 1) Building, 2) Room Number & 3) Type . . . Query currently opens in a the spread sheet view that shows those three things but also the Access Tag Number associated to them.

I would like that Access Tag Number to just return into the field that was double click to start the query.

Is this possible? If so what am I missing?

View Replies


ADVERTISEMENT

Forms :: Using OnClick Event To Open Query Text Displayed In Form Field?

Oct 10, 2013

I have a table that holds the SQL texts for ca. 1000 Select queries (mostly minor variants that are used to programmatically swap out RowSource strings for combo boxes). I'd like to have a quick and easy way to open/review/modify these queries.

One strategy would be to display the SQL strings in a field on a Datasheet form, then use an onClick event on a text box linked to the SQL-holding field (or perhaps an onClick event tied to an unbound text box on the form) to open the associated query. That would allow me to view the SQL of the query that I want to open, allow me to quickly scroll through the list of stored SQL texts, and give me options for sorting or limiting the SQL-texts displayed in the datasheet form.

But, I can't seem to get the onClick event to work. The problem seems to be that I can't figure out how to pass the SQL string contained in the field to a function that will use that string to open the query .

View 10 Replies View Related

Forms :: Expression On Text Box Returning Wrong Value

Mar 29, 2013

I have a form used for taking inventory. One table to lookup items, one for writing values. Tables linked by an ID #. I created a text box on my form to lookup a value called PARQTY in the lookup table. I need to be able to subtract that value from the QTY that is entered into the Qty_Counted box on teh same form when they take inventory.

I created a new Text box and in the control source for it, I entered an expresion that basically says subtract The PARQTY from the QTY_COUNTED it reads = [QTY_COUNTED] - [PARQTY]

The box is subtracting the QTY_COUNTED from the ID # that is linking my two tables and displaying it. Its not supposed to be subtracting the QTY_COUNTED at all. It should be subtracting the PARQTY value that is displayed from the QTY_COUNTED. The PARQTY box does display the right value from the lookup table so I can't figure out why it's pulling that ID number or where from. The rest of the form / program works and we've been using it for a few years. I also created that, but like now, I had to muddle through each and every little thing I did.

View 9 Replies View Related

Forms :: Change Text Color On A Form If Text In Field Contain Certain Word

Jul 12, 2013

I have a Form Display Data in my Access Database, which is working really well. However, users was asking if there is a way we can make Font Color Could/would change if The text in A field or Any field in my display form contained the word "SAD or MAD". Is there code for such thing in display form?..

View 3 Replies View Related

Forms :: Formula Not Working - Empty Field Returning

Jan 31, 2014

I have a date in "date to engineering" of 13/ 01/2010 but I am not getting a value in my field which should be 1479 my field is just always returning an empty field

Code:
=IIf(IsDate([date to engineering]),"",IIf(IsDate([date from engineering]),Now()-[date to engineering],[date from engineering]-[date to engineering]))

View 4 Replies View Related

Forms :: Added A Field Using Expression Builder Which Is Returning Name?

Jan 18, 2015

So I have built a form and added a field using the expression builder which is returning #Name? There is a relationship between the table on which the form is based and the record I am adding to a control.

View 1 Replies View Related

Forms :: Validating Text Field On Form Against Another Field In Same Record?

Apr 17, 2014

I have a form where I would like to validate (restrict) choices in subsequent fields.

Example

Combobox choices are Air, Fire, Water, Earth, Space

In the form I have 4 fields = Material1, Material2, Material3, Material4. (all in same record on my table)

Basically I need the validation to not allow duplicates across the 4 fields.

something like....

[Material1] <> [Material2] or [Material3]or [Material4]

I am not sure of the proper syntax for the validation field in the Form Properties. Or if I am even putting it in the right place.

View 3 Replies View Related

Forms :: How To Populate Bound Text Field With Text From A Unbound Text Field

Mar 22, 2014

I have 4 fields that are unbound on a form. img1 img2 img3 img4..When these are entered they are all combined and autofill another unbound textbox = imagename.. what i would like to do is from this unbound textbox 'imagename' ..i would like to populate a textbox that IS bound called FileName

[Event Procedure]
Private Sub imagename_Click()
Me.imagename = Me.FileName
End Sub

View 4 Replies View Related

Forms :: Open Blank Form Based On Value In Text Field In Main Form

Jun 6, 2013

I have one table containing name of restaurant with its address etc. Then i created another table to list out the restaurant workers names and details. Just as an example,

Table:Restaurant
Restaurant name
Address line 1
Address line 2
Restaurant #
Website

Table:StaffContact
Staff Role
Name
speciality
email
phone

I have the main form that has all the restaurant details only. And i have another form containing the Staff information. Please note the two table have a relation and it works well.

Now to make it user friendly(basically easier for the lazy ones), I dragged the staff contact form on to my main form and displayed it as a datasheet(basically a sub form).

Now, my boss does not want users to add/delete on this sub form(datasheet). So,he wants me to create buttons to open new record of staff for each restaurant(new form)

My issue is with opening a new record to enter a new person to the staff list and give them a role as well in form view.The new form has

So i ran a Macro, with open form with Where condition

Code:
[Staffcontact]![Rest Name]=[Forms]![MainForm]![RestaurantName]

But, it does not work .

View 2 Replies View Related

Forms :: Copy Value Of Text Field Into Another Form

Jul 8, 2015

My problem is that I want to copy the value of a text-field of form frmSnippet into another text field of form frmChange. But this is not possible, Access tells me that it can't find the form frmChange. But it's there, I checked the name.

My code looks like this:

Const cstrForm As String = "frmChange"
Dim strNr As String
If CurrentProject.AllForms(cstrForm).IsLoaded Then
DoCmd.Close acForm, cstrForm
End If
DoCmd.OpenForm cstrForm, WindowMode:=acDialog

txtSAPNr.SetFocus
Forms!frmChange![txtSAPNr] = Me![txtSAPNr]

Why I get the runtime error 2450?

View 5 Replies View Related

Forms :: Updatable Text Field On Form?

Jun 19, 2015

I have a form (frm_riskcalc3) which its data source is a table called: tbl_targets, on the 'frm_riskcalc3' form are; 15 unbound label text Fields and 15 unbound number value fields that are pre-set with data, I need to find a way to allow these fields to be updated without changing what their values were before.

[URL]

View 1 Replies View Related

Forms :: Watermark Text In A Form Field?

May 10, 2013

You often see (particularly on websites) a form field with greyed out text displayed in it, that disappears when typed over - so for example you could have name/address or whatever is supposed to be typed into that field showing.

I'm not looking for default text typed over or anything - a purely visual effect not stored in the tables.

View 8 Replies View Related

Forms :: Combo Box Keeps Returning First Record In Query?

Jan 27, 2014

I am using A2007 and this one combo box is returning the first record of a query no matter what record I pick. My other combo boxes are working fine.

When I pick a record the "after event" works fine by placing the data in the proper text boxes and then returns the first record in the query.

View 3 Replies View Related

Forms :: Populate Field In One Form From Text Box In Another Form

Jan 18, 2014

There are two forms invoolved in thi

pfrm_AddClientPrimary
pfrm_AddClientDuplicateCheck

On a command button in pfrm_AddClientDuplicateCheck I have the following code.

Code:
Private Sub cmdAddNewClient_Click()
DoCmd.OpenForm "pfrm_AddClientPrimary"
DoCmd.Close acForm, "pfrm_AddClientDuplicateCheck"
End Sub

This works great

On the onOpen event of the pfrm_AddClientPrimary form I have this code

Code:

Private Sub Form_Open(Cancel As Integer)
Me.FirstName = Forms!pfrm_AddClientDuplicateCheck!txtFirstName
Me.LastName = Forms!pfrm_AddClientDuplicateCheck!txtLastName
Me.SocialInsureanceNumber = Forms!pfrm_AddClientDuplicateCheck!txtSOcialInsureanceNumber
Me.FirstName.SetFocus
End Sub

This fails on the first line with this error
Run-time error 2147352567 (80020009)
You can't assign a value to this object

I am aware of the incorrect spelling of Me.SocialInsureanceNumber this is the way it is in the db.

View 4 Replies View Related

Forms :: Field Auto-size To Text In Form?

Nov 19, 2014

I am relatively new to using MS Access 2010. Some fields which i have set up as Memo fields to take report comments. Is there anyway to make the size of the memo field box variable to fit in with the text in the form when viewing in htis mode?

View 1 Replies View Related

Forms :: Setting A Field On Form To Only Allow Text Input

Jan 9, 2014

Is there a way to setup the format on fields to only allow text inputs, no numbers wanted. I know I can do this at the table level but is some cases numbers are ok. So I want to code it so I can control when numbers are ok and when there not.

View 1 Replies View Related

Forms :: Populate Hidden Text Field Of A Form From Datasheet

May 17, 2013

I have a form with a button that pops up a datasheet with a number of records. I need the dbl click event to populate a hidden text field with the id of the item that was double clicked.

Ive found the double click even and can get the double click to close the window, but i need to populate the text field as well.

View 1 Replies View Related

Forms :: Search Form With Each Field In Separate Text Boxes

Dec 8, 2014

i want to search a phone number in contact information table with column names - number, name, address, dob, gender, f-name, m-name etc and show them in a form with each field in separate text boxes in access 2010.

View 4 Replies View Related

Returning True/False To A Form When Query Is Run?

Mar 9, 2007

I'm really not sure how to go about this. I'm creating a course booking system and when creating a booking I need to check for current bookings with the same employee and course id's (i.e. the employee is already booked on the course). The query takes the employee and course id's from a form, and is initialised when the 'book' button is pressed. It correctly selects if the person is already booked on the course but I want the query to return a value to the form i.e. if it returns null/false then the booking can be created but if it returns a record/true then the booking already exists and a message box can be displayed.

I'm not sure if I'm going about this the right way, can anyone suggest how this can be done as described above or suggest a better way of doing the task?

View 5 Replies View Related

Question Regarding Returning Query Selection From A Form

Jan 11, 2006

I have a table called Prem. It contains three fields (Offer, MailCode, MktgProgam). I want to have a form where a user can select. the Offer (from the offer field) Once selected, it takes the MailCode and MktgProgam information from the Prem table and uses that info (MailCode, MktgProgram) to pull from the main table called "Cust" Is this doable?

Thanks in advance

View 4 Replies View Related

Modules & VBA :: Calculating Information For A Text Field On A Form From A Query

Aug 4, 2014

I have a data entry form [Resources] and I would like to display some information about holidays in the form footer. Once the user has picked a combination of Trainer_Name and Start_Date I would like the 'On Change' or 'On lost Focus' event (not sure which would be the best) to perform a datediff calculation.

The datediff calculation would compare the difference between the start date entered on the form and the most recent past Start_Date on a query called [Hours Holiday_P1].I could adapt the same code to also look for the difference between the End_Date on the form and the next Start_Date on the Query.The idea is that when resourcing trainers I know how long it is since and how long it is till their next holiday.The sql for the query is

Code:
SELECT Resourcing.Start_Date, Resourcing.Trainer_Name, Resourcing.Duration, Time.Hours, [Hours]/7.4 AS Days
FROM (Resourcing INNER JOIN Employees ON Resourcing.Trainer_Name = Employees.Trainer_Name) INNER JOIN [Time] ON Resourcing.Duration = Time.Time
WHERE (((Resourcing.Start_Date) Between DateSerial(Year(Date())-IIf(Month(Date())<4,1,0),4,1) And DateSerial(Year(Date())+IIf(Month(Date())>3,1,0),3,31)) AND ((Resourcing.Activity) Like "Holiday*"))
ORDER BY Resourcing.Start_Date;

View 14 Replies View Related

Forms :: Query Linked Form Won't Allow To Add Text Box

Sep 29, 2014

I am using Office 2007 and have a form that is linked to a query, also I have a sub form linked to the same query. I cant understand why both forms say in their properties that they are linked to a query but when I try and add a text box to show customer ID it tries to show data from a table

View 1 Replies View Related

Forms :: Columnar Sub Form Text Box Fetch Query?

Jun 24, 2013

I have a Columnar Sub form for for a Sales order for capturing the item details.

I have setup a combox for item code for which the respective item description data has to be fetche from item master table and populated in itemdesc table.

I am written a after update code in the combo but after selecting each row the item being fetched and updated in all rows is of the last row.

*********
Private Sub itemcode_AfterUpdate()
Me.itemdesc.Value = DLookup("[Description]", "itemMaster", "[code]='" & [Forms]![frm_invtmpDetails]![itemcode] & "'")
End Sub
*********

View 7 Replies View Related

Forms :: Can A Query Be Used As Control Source For Text Box On A Form

Jun 7, 2013

Can a query be used as a control source for a text box on a form?

=[QueryLibrary]![Kit] is the control source do I need to change anything else?

View 3 Replies View Related

Forms :: Result From A Query Being Passed To Text Box On Form

May 6, 2014

I am making a database for my work place where there is telephone counsellors and they need to complete a certain number of supervision hours and a few other categories of hours required for training and several other things. The manager wants to be able to see the total supervision hours and the other categories for a worker when the worker is selected and the date range for the queried time entered.

I have a form that has quite a few items on it. I have two text boxes that allow me to enter a start date and an end date, I have a combo box that allows me to select a worker and I have 3 text boxes that I want to populate with the sum of 3 separate columns in another table when the date is entered and the worker selected so the manager can see, at a glance, how many hours each worker has done on the separate items. Maybe I would need an update button at the bottom that, when clicked, would perform the required calculations.

I have 3 queries that return the required information but I need to get one of the columns from the query results put into each of the 3 text boxes. Basically, when I click on the buttons the right query appears, I just want column 3 (which is a sum column) to get put in the corresponding text box and I want all the boxes to display the sum of their corresponding queries when a date and person is selected.The form is called frmSearch, the 3 queries are called qry_sumisshours, qry_sumisshours and qry_sumtcshours. The 3 text boxes I need to get populated from the queries are called txt_ results_ sv_ hours, txt_results_TCS_hours and txt_results_iss_hours.

View 10 Replies View Related

Queries :: Form List Based On A Query Returns Original ID Value Not Field Text

Aug 14, 2014

I have a table x where the field value is selected via a combo box in a form that is populated from another table z.

When I look in x, it appears to have correctly stored the text from z, not the ID number.

I then built a Query, qX, which looks in x and grabs the fields I want. That query shows the text correctly in each selected field.

Now when I build a form, frmQx and use a List control, it displays some of the fields as ID values from the original table z, not the text values.

How can I get round this? I've searched and searched for an answer, sigh. Maybe I'm just not quite certain how to phrase the search.

View 5 Replies View Related







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