Selecting A Field From A Popup Form To Be Populate Another Text Box
Apr 6, 2008
I have a field on frmOutpatient which is called EpisodeID.
I need to populate this field from a selection in a pop-up form.
The pop-up form (frmSelect) is a continuous form with a number of different EpisodeID numbers according to the date the patient was admitted. At the end of each record I want to put a command button (cmdSelect) and when pushed I want this SelectEpisodeID to be transferred to the field on the frmOutpatient.
I have two tables - Interviews & Placements.these tables have multiple foreign keys which pull information from other tables (CandidateID,ClientID etc). I have designed queries and forms (datasheet view) which display all the values that I need, For example:
The interview form shows the following fields: CandidateName;Company;consultant;1stInterviewDate; 2ndInterviewDate;Offer;Accepted
the placements form shows the following fields: PlacedCandidate;Company;Consultant;PlacementDate;F ee;
This query "qry_Interviews" populates these forms using the foreign keys:
CandidateID from candidates table CompanyID from companies table consultant from consultants table
Ideally what I'd like to happen, is when the "accepted" field is updated on the interviews form, the placements form opens as a pop up and is auto populated with the values (CandidateName;Company & consultant).So far I have tried setting the value directly, i.e on the "on Open" event of the Placements form I entered:
This does not work. Should I be populating the placements form with the actual Foreign key values rather than the resolved names? Ideally I'd want the pop up placements form to display the actual names rather than just ID numbers.
I have with my database. It's holds cost data including purchase made in foreign currencies which need to be converted to GBP using the correct exchange rate so a variety of reporting & stats can be performed.I have a table called Costs within which there are 2 fields
Purchase Currency Exchange Rate
I also have another table called Exchange Rates 13/14 within which there are 2 fields
Currency Exchange Rate
When a value is entered in the Purchase Currency field on the Costs table (this is a look up field linked to Exchange Rates 13/14 so it shows the listed currency in drop down) I need the database to automatically populate the Exchange Rate column in Costs i.e. match the value in the Purchase Currency field to the Currency field in Exchange Rate 13/14 and populate with corresponding Exchange Rate from Exchange Rate 13/14.I have tried the following and none work:
SQL Tried
1. UPDATE Costs SET ExchangeRate = [Exchange Rates 13/14].[Exchange Rate] WHERE Costs.[Purchase Currency] LIKE [Exchange Rates 13/14].Currency
2. UPDATE Costs SET ExchangeRate = [Exchange Rate] FROM [Exchange Rates 13/14] INNER JOIN [Exchange Rates 13/14] ON Costs.[Purchase Currency] = [Exchange Rates 13/14].Currency
3. SELECT [Exchange Rate] FROM [Exchange Rates 13/14] WHERE Costs.[Purchase Currency] LIKE [Exchange Rates 13/14].Currency
I know it is possible to have a drop down for Purchase Currency which shows 2 columns (both Currency and Exchange Rate) you can then use the exchange rate figure for a calculated field. The problem I have is that I am importing data into the costs table from excel. In Excel I can only have 1 value in the Purchase Currency column on the upload template. If I just have Euro in this column the database does not match it to the Euro in the Purchase Currency drop down and also store the correct exchange rate.
Or is the alternative to put this into the calculation of GBP Unit Cost where this somehow matches the Purchase Currency in the Costs table to the Currency field in Exchange Rates 13/14 tables and uses the appropriate exchange rate from Exchange Rates 13/14 to calculate GBP Unit Cost in Costs table.
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.
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.
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
I know how to do an action on doubleclick or mouseover but I want some simple text to come up, possibly with a white background behind it that has some details about the specific production number that the user is clicking on. Is there something like this? I tried a dialog but it brings up an ugly form, I just want the text or something simple. Can this be done?
I have a form with bound textboxes used for entering currency values. When the form loads the fields are automatically populated with default values. When the user clicks on one of the fields, I would like to automatically select all of the data in the field, so as new values are entered, the defualt value is overwritten. I imagine that I should use the OnFocus property, but is there a command to highlight the data?
Hello, I'm working with SQL and databases in general for the first time, and was wondering: how would I select just the most recent entry for each device? my data looks [roughly] like this:
I'm working on a table which has a country field, but this field may contain a text string consisting of more than one country, eg "France, Belgium, Spain"
I want to run a query against the table to select records for any one country, but not sure how to do this.
I have a text field that I would like to have some information automatically populated when the form is open. I know the basics but the trouble I am having is having the date and time populated before the default text.
Here is what I tried but no luck on it
Code: Private Sub Form_Load() Dim strQuery As String 'Dim js As Integer Dim currDateTime As Date currDateTime = Now() Me.Description = " & currDateTime & " & " " & "J.Adams 41066 CLT SMB - AM : " & " " & "" End Sub
In my Student Administration database I am trying to launch a popup form from a sub-form of a Job Positions and Seekers form. The sub form is actually one of 2 sub-forms, both Continuous Forms default view, on a form linked via an unbound control (MasterJobPosID).
The first sub-form is called and lists open Job Positions and the 2nd sub form is called and lists all Students Seeking each of the positions. The Students Seeking subform is linked to the unbound control MasterJobPosID in the main form which is set to equal the Job Positions subform's JobPosRecNo field which is the key to the Job Positions table.
The popup form is called Job Employment and is being launched via an event macro from the Students Seeking subform. It will allow the user to create a record in the Job Employment table. The event macro has a Where statement that says "=JobPositionID And Student", an attempt to link it to both the Job Position record being filled and the Student filling it.
I am able to populate the popup form's fields in expressions setting Default Values equal to fields on the loaded Job Positions subform and the Student from the Students Seeking subform. What I am unable to get is the Job Position record key from any of the 3 fields it appears in on the Job Positions and Seekers form:
MasterJobPosID on the main form.JobPosRecNo on the Job Positions sub form.JobPositionID on the Students Seeking subform.
I want that to link the new Job employment record to the Job Position record the student is filling. In fact I get a parameter prompt for JobPositionID when the popup form is launched.
I have a continuous subform with an unbound Concat textbox and would like to populate another field for each record with the results with a main form button onClick event.
I am trying to create a login form with the following three basic fields:
txtUsername cboUsertype txtPassword
I would like to be able to populate cboUsertype with User types associated to the user I type into txtUsername. I have found many useful tutorial on the web on login procedures. How ever I hardly found anything on how to populate a combobox after updating a texfield. It bis more than a week that I am trying to find a solution but until now I have just been . I would be grateful if you could provide me with either a link on the web or a vb code to make it work.
I would like the "DateOfConfirmation" to populate with today's date when "SSurvDiagThisYear" is Confirmed.
The DateRecordCreated is a simple =Date() that populates when the record is entered into the table.
SSurvDiagThis Year is the case outcome - Pending, Probable, or Confirmed. It is possible that the case could be confirmed on the same day it was entered into the table but that is RARE.
I am hoping for the The DateOfConfirmation to capture the date the case is confirmed so that I can gather some duration between the case being opened to confirmed.
I know how to do this with a combo box. After defining the SQLtext and WClause something like:
with me.cbocombobox ____.rowsource = SQLtext & Wclause ____.requery end with
How do I (can I?) use the SQL in VBA to populate a text box in a similar manner? I have tried various versions of me.textbox = sqltext & Wclause etc, but to no avail.
When I populate a combo box named BusOrgCode, I want to auto-populate the HRName box with the name that corresponds with the Bus Org Code. I get a run time error "2001." Help!
Here's my code: +++ Private Sub BusOrgCode_AfterUpdate()
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function. strFilter = "BusOrgCode = " & Me!BusOrgCode
' Look up HR Partner Name and assign it to HRName control. Me!HRName = DLookup("HRName", "HR by Bus Org Code", strFilter)
I have a report that lists incidents for a specific day (reference number, a brief description and a few other fields). There is also an additional notes field, which I would like to be viewable from within the report.
For example, as a tooltip when the mouse hovers over the brief description text box. Or displayed in a textbox on the right (I don't want one textbox per line though, but instead a single re-usable textbox). Or a more information button/link that shows a "popup" containing the additional notes. I don't want to exit out of the current report, but stay within it.
I have tried to achieve this with a tooltip, but in fact even when I manually typed in a tooltip on the control's properties it wasn't displayed when I hovered over the text box.A pop-up or floating textbox would be preferable.
I am trying to populate a txtBox on the SubForm of a Form, Using a Set Value Function = DlookUp function. The DlookUp Function searches for a value in the table and compares it to a value of another txtBox of the subform .The problem is:
-Using the Left Switch on Mouse works fine, txtBox is populated correctly -Using the Enter Key does not work; it clears the box used for the seaech data and does not populate the txtBox.
I tried placing the procedure in the After Update event and also placing it in the on Enter event to no avail.
I have a onclick tied to a label (for decoration purposes) that when clicked it launches VBA that essentially updates a form. All that part works except it will not recognize any changed value of the field I was last in?
Just to try to explain best as I can what happens.
- Form gets opened - I change field (quantity field) - I click the Label - It reverts to pre-existing value.
if I click off of the text field first then do the onclick - it recognizes just fine.
I am new to access and have been staring at the same Run-time error for 3 days (pathetic I know). I cannot for the life of me figure out why it does not like my Dlookup. Esentially, I want and After Update event in my combo box to populate a Rich text textbox in my form. After reading DLookup is the easiest way to make this happen. Here is my code:
Trying to pull information from a text box on double click to populate a combobox on another form...
keeps coming up "type mismatch"
I call lngAccount as recognised on mouseover... ("Business Account" is the value I want)
I can't get it to work!
For info, the form I'm calling from is a subform located FrmMainMenu/FrmAccountsMainMenu and the control source is [Account]
the form I wish to populate in on FrmTransactions (it is a main form only) and the combobox is cboaccountselect - **I've seen the obvious mistake with no reference to this whatsoever, corrected it, and still not working**
I am in the process of (attempting) to develop a database and application for Parking & Violation Management. I have two tables at this point: "Parking Registration" and "Violations" that are linked by a "Permit #". I have developed a form that will allow the officer to enter either the "Permit" or the "Licence Plate" of a vehicle to run a "Vehicle Check" query to produce specific information for the vehicle in question; which is what I wanted, kind of... The problem is that the resulting data pops up in "table" format, and contains multiple fields, making review of the data difficult due to its lengthy, linear nature. Is there a way to have those results appear in text boxes either on a separate form or the "Vehicle Check" form itself?
Trying to update a field in a record in my form after selecting from a comboox.
This an orders form with a record per row for order items. I select the product from a dropdown list which is populated by a dynamic query from the afterupdate event on another combo. When I do the selection access reports the following error: Runtime error 3331 to make changes to this field, first save the record
Debug takes me to the line : Me!product_id = DLookup("product_id", "products_table", myvar) from : [code] Private Sub comboProd_description_AfterUpdate() Dim strFilter As Integer
I'm lost as to what to do (no such thing as beginners luck!!). I'm not even sure if the error is from the combo box or from the field that it is trying to update (product_id)
I have attached a sample of my DB so you can see for yourself what i am trying to do. I want to capture the SSN on the search page so when I go to P1 or P2 that persons info is all ready populated on the right side of the page, but still allows for a search after I have updated the record.