Modules & VBA :: Find Combo / Sum That Equals Target Value?

Jul 12, 2013

I want to ensure that employees submitted expenses that were actually valid. In table 'Payments', I have the employee ID and amount paid to that employee's account. In table 'Expenses', I have the employee ID and then the individual expenses the employee submitted. How can I create some VBA to find combinations of the employee's records in 'Expenses' that equal the total amount paid for that same Emp ID in table 'Payments'? My ideal end-result would be a report showing each employee IDs with the expenses and then the amount paid beside it. The below is a good start but I need to make it loop through every unique Employee ID.

remove spaces from URL

[URL]

View Replies


ADVERTISEMENT

Forms :: Combo Box To Be Selected If Another Field Equals 0

Mar 11, 2014

I have a form (PostProductionForm) which is used to input data about finished goods which come off a production line. There are three possible outcomes which can occur after the production: Passed, Reprocessed, Failed and the numbers for these are entered in 3 text boxes on the form (QtyReprocessedTxt, QtyFailedTxt, QtyPassedTxt).

These text boxes are auto populated with a 0 from the table (PostProductionTbl) so there aren't blanks.

What I am trying to do is use an IF function (I think) which says that if Quantity Reprocessed is equal to zero when the submit button is pressed, the "Reason for reprocessing" combo (RPReasonCombo) must have something selected (i.e. can't be blank) or it won't go to a new record.

View 5 Replies View Related

Forms :: Combo Box Works Only When Target Form Is Initialized

Jul 2, 2013

I have two forms. In form 1, there is a combo box that I have set on click to open form 2 in this manner:

Code:
Private Sub boxEditEntry_Click()
DoCmd.OpenForm "frmSRTEdit", , , "[ControlNumber]=" & Me.boxEditEntry
End Sub

The thing is, this has only worked when Form 2 is already open. I can't figure out why. If Form 2 is not open or has not been opened, the on click will still open Form 2, but not to the value in the combo box, or any value for that matter, it's blank. I really need it open if has not yet been opened or if it has been closed before. Also, I'm fairly new to access and I have no clue what I'm doing in vb.

View 2 Replies View Related

Modules & VBA :: Add 7 Days To Todays Date To Store Target Date In Table

Dec 9, 2014

How can I add 7 days in todays date to store target date in the table?

Code:
ssql = "Insert into tblUpdate([Update_ID],[Date],Username,Status,Target_Date) values('" & j & "',#" & Format(Date, "mm/dd/yyyy") & "#,'" & k & "','Open')"
CurrentDb.Execute ssql, dbFailOnError

View 3 Replies View Related

Shortcut Target Not Valid

Dec 3, 2005

Trying to make a shortcut to join the workgroup and open a Db.

I made a shortcut for a Db, the shortcut defalt target was:
X:RC-OfficeRC_OFFICdatabaseProjects.mdb

I edited the target line to:
/wrkgrp ”X:RC-OfficeRC_OFFICdatabaseMS Access Workgroup.mdw” “X:RC-OfficeRC_OFFICdatabaseProjects.mdb”

I get wrkgrp not vaid target. I put the mdb file path first, I get not vaid target for the path to the Db.
I would rather not put in the whole MS Access program file. This is on a server that I don't know much about. Not sure I would get the program file right.
Help?

View 3 Replies View Related

Apostrophe In Target Db Name Throws Error

Dec 14, 2007

sql = "SELECT Table1.* INTO Table1 IN '" & sExpFileName & "' FROM Table1"
CustDB.Execute sql

where the sExpFileName contains the path of The Target MS Access DB
The Query works fine. But recently I discovered that if my target File name contains apostrophe It gives error as Query Input must contain at least one table or query

Is there any way to solve this problem. Please suggest me some way

View 7 Replies View Related

Get A Field Only If It Equals What I Asked

Sep 18, 2005

I have a table with data of people, in which table two fields contain two (not necessarily different) jobs.

I want to build a query (and later a report based on that query) which will return the name, address, phone of the person, plus only the field of the job that I asked for it.
when executing the query, the user should enter the asked job in a popup-box using the below formula.

Like "*" & [job] & "*"

Note, that there may be records containing in both job fields the same job. I want to get the field only if it contains the asked job.

Any ideas?

Thanks

View 12 Replies View Related

Query Equals Text Box

Sep 11, 2007

Hi,

I have had a look at quite a few threads, but cannot find what i need. I am looking to show a command button if the value typed into the text box equals one of the values in the query. I understand how to show/hide a command button due to another post, but it is getting this to happen IF the text box matches one or more of the values in the query.

I have txtCustNo as the text box to type a number into
I have qryCustNo as the query name
i have cmdFindCust as command button

Should i have the code under the "after update" part of the text box also?

Thanks for your time,

Emily

View 4 Replies View Related

Delete Query To Target Fields Not Rows?

Sep 5, 2007

Hi

I need to know if it is possible to create a delete query which will target particular fields in a row based on certain criteria in a seperate combo box(on same table).

The few ways that I have tried to do this have been unsuccesful so if anyone can shed some light on the subject it would be greatly appreciated.

View 5 Replies View Related

Queries :: Qurey To Link With Target Date

Dec 24, 2014

I have to make a query using the following case, I have two tables, in the first table i have the materials and its received date and in my second table i have the month the target date for every month to receive the material. Now linking this two tables, i want to see the from the first table on every month hom many materails i received after the target date how to do this.

Table 1
Field1 Date
Field2 Month
Field3 Material
Field4 received_date

Table 2
Field1 Month
Field2 Target_date

View 1 Replies View Related

Code To Store A Value In Table Where ID Equals To X

Mar 13, 2014

I have my Jobs form which has a sub-form for all the different parts used on that job which then calculates the total charge and displays this on the main jobs form. Now how would I get this value to be stored in table tblJobs on the record where the ID = JobID on Jobs form. I need to do this to display the total on a report.

Looked around and couldn't find what I was looking for, is there a visual basic command to set it then I can use docmd.saverecord after or what would I need to do?

Or is there an SQL statement to do this I could execute on a button click or something similar?

View 9 Replies View Related

Forms :: Unbound Text Box Equals List Box Column

Mar 11, 2013

why =listboxname.column(0) in the control source of a textbox will give me the value "#name?" ? I've used it successfully on another form..but for some reason its not working for me.

View 6 Replies View Related

Queries :: Calculation That Counts Where Values Equals 4 In Fields

Nov 15, 2014

I have six fields in a record that look like Median.University1, Median.University2, Median.University3, Median. University4, Median.University5,Median.Unive rsity6. How can I create a calculated field that counts where values equals 4 in the fields . I have tried Dcount and Count with no success.

View 7 Replies View Related

Repeat Macro Until Record Count Of Query Equals To 0

Aug 9, 2012

I have a macro that needs to run repeatedly until the number of records in a query =0 but I can't seem to get the Repeat Expression set properly.

My query is called sqMatchCount:

SELECT Count(sqCompare_Parts_Matched_1st.BRP_Entry_Num) AS MatchCount
FROM sqCompare_Parts_Matched_1st;

The theory is if I don't have any more matches then I do not want the macro to run any more. In other words, MatchCount will = 0 when there are no more matches.

I have tried a variety of syntax using DCount in the Repeat Expression:

=DCount("*","sqMatchCount") ...... Macro runs in a continuous loop
DCount("*","sqMatchCount")=0 ...... Macro does not run (although I thought a couple times it actually DID run with this syntax)
DCount("MatchCount","sqMatchCount")=0 ...... Macro does not run
=DCount("MatchCount","sqMatchCount")=0 ....... Macro does not run
=DCount("MatchCount","sqMatchCount") ....... Macro runs in a continuous loop

What IS the proper way to write this Repeat Expression for the RunMacro Action if I want it to run as long as sqMatchCount.MatchCount>0?

View 14 Replies View Related

Update Field On Separate Table If Result From Form Equals Certain Criteria

Mar 17, 2012

I have a form, which i use to book in products received. What i want to do is if the quantity received is equal to what was ordered then i'd like to update a yes/no field (Order Complete) on a separate table to true.

View 8 Replies View Related

Find Record Based On Combo Box

Mar 17, 2005

Hi

I have a search form with 1 combo box and a button which when the user inputs an invoice number and clicks the button, a main form is opened for that particular record.

The problem I have is to display an error message before the main form opens if the user has either left the combo box blank or they have input an invoice number that doesn't exist.

This feels like it should be easy......!

Thanks for any help

Georgina

View 3 Replies View Related

Combo Box To Find Record - Wrong Value!

Mar 20, 2006

Hello,

I have a form and I have added a combo box to quickly find records. I used the wizard to set this up as I did not know the code. Anyway this works, but it displays the wrong value - it displays the ID number and not the text value from the table.

The record source is a table not a query.

What am I doing wrong here, I have tried changing the control source and it doesn't work.

Any suggestions?

View 5 Replies View Related

Update Find Combo Box After Add Record

Sep 8, 2006

I have a combo box at the top of a form which is used to find records. When new records are added using the form, they do not show up in the combo box until the form has been closed and reopened.

Can anyone tell me how I can requery the combo box to ensure that it does list newly entered records?

Thanks,

Gary

View 1 Replies View Related

Find A Record Combo On A Subform

Sep 11, 2006

Hi all,

I have a form for accounts, which has a subform listing the customers within each account.

On the customers form I can use the wizard to add a combo to find a record, but if I want to add a similar combo within the subform, the option does not appear in the combo wizard.

Can anyone enlighten me on why/how to resolve?

Many thanks

Mark

(using Access 2003 on an Access 2000 format db, Win XP Pro SP1)

View 1 Replies View Related

Combo Box To Find Records From Multiple Tables

Jul 30, 2013

I have a main form that has fields from different tables. This is a research study, so each form enters data into different tables. Well, each record is a person's data. Instead of scrolling through each record, I need an option on the main form that allows me to search for a specific person and have their data populate into the form.So far I am able to make a combo box that pulls up the record from one table. Well, HOW do i do it from ALL the tables!?? Do I have to make a query?

View 3 Replies View Related

Find A Record On Form Based On Value Selected In Combo Box

Jun 2, 2014

I am trying to add a combo box into a form and when the Combo Box wizard pops up I only get two choices:

I want combo box to get values from another table or query. I will type in the values I want

I want the third option...

Find a record on my form based on the value I selected in my combo box.

Why am I not getting the third option??

View 1 Replies View Related

Creating Form To Target Current Record Open In Another Form

Apr 17, 2014

I have three objects a Main_Table , ClientDataForm and a MapForm all three share a common ClientID number

From that Main_Table I have created a ClientDataForm form which I enter all Data

From ClientDataForm I wish to create a button on it which runs a Macro that Saves ClientDataForm Record and then populates another form named MapForm with whatever record is currently open in Form One whether a newly created one or previous record.

How would I write this code for that button? Also why I would write it that way?

View 3 Replies View Related

Modules & VBA :: Cannot Find Object

Nov 27, 2013

message "cannot find the object "." ". I have looked in the VBA for the Report I am working with and the form that has the underlying data and cannot find the rouge period! I am creating a label for payment envelopes that is gets its data from the form that indicates payments made

View 1 Replies View Related

Modules & VBA :: Using LIKE In A Field To Find A Value

Mar 16, 2015

I'm lost on how to use the LIKE to find a value in a field.

I try to use the open folder if a field contains "Retail" or any other containing as a part. So, I could have just "Retail" "New Retail" and then act on it.

How can I use the below proper?

Code:
If Me.Business_Type Like "*" & "Retail" Then

View 4 Replies View Related

Modules & VBA :: Find Name Of Textbox Control

Jan 30, 2014

I'm looking for a way with VBA to find the name of a textbox control after inserting the cursor in that textbox.

View 3 Replies View Related

Modules & VBA :: Textbox Value Find Primary Key

May 1, 2014

I have an unbound textbox in a form which is filled with a text value eg "RWL" when the form opens. I now need another textbox that goes to the Company Data base finds the "RWL" text and finds its Primary key and puts it in the new textbox?

View 5 Replies View Related







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