Forms :: DLookup To Return Form Load

Dec 12, 2014

I am trying to create a multi-user web-based database where all users log-in and see different forms based on a field in the user table.

I am trying to use a DLookup to return the name of the Form I want open based on the command box that shows the userID and UserName

DoCmd.OpenForm , acNormal, DLookup("field", "table", "[UserID]=" & Me.cboName.Value)
cboName row source
SELECT [table].[UserID], [table].[UserName] FROM table ORDER BY [UserID]

View Replies


ADVERTISEMENT

Reports :: DLookup With Auto Date - On Load Sequence

Dec 17, 2014

Ok, so I have this table (tblPayPeriod) with the fields Start Date, Stop Date, Pay Period & Percent FY. The Percent FY field is a Number field that gives off the percent of the fiscal year (FY) that we are in.

Then I have a report (rptDistrictMgr) that in the header I want it to display what percent of the fiscal year we are in based on the Auto_Date that is in the header.

So, if the Auto_Date is December 17, 2014, we are (according to tblPayPeriod) 24.1% into the fiscal year and I want the 24.1% to display in the text box which called Text99.

I would just like a simple dlookup that I can use as the control source of the text box or an expression to put into the On Load sequence.

View 6 Replies View Related

Forms :: On Load Form Error

Apr 3, 2014

I have built a database which has a number of forms with a frm_PartNo subform in.When ever I click a button to load one of these forms I get the following error message: ECN Database v1.31 cannot find the referenced form 'frm_PartNo'. But when the form loads the sub form is there with all the related data !

View 5 Replies View Related

Forms :: Maximize Form On Load

Nov 2, 2013

I'm a newbie using Access 2007.I am trying to make things as easy as possible for the user of a database that I have been working on. The users maximum screen resolution is 1600 x 900 and I want to have specific forms automatically "maximise" to fit the screen.I have set the Form property "Fit to Screen=Yes" but it does not do what I am expecting and want.I also have "Auto Resize=Yes"

View 4 Replies View Related

Forms :: Filtering On Form Load

Aug 9, 2013

I am having a problem filtering a form on load.What I am trying to say is if the role = Agent then filter on todays completed records and records that have a completed date of Null for the particular agent.

Here is the code:

If Me.txtRole = "Agent" Then
AgentFilter = "(CASEOWNER ='" & Me.txtName & "')"
DateCompletedFilter = "((DATECOMPLETED = #" & Date & "#)OR (DATECOMPLETED Is Null))"
DoCmd.ApplyFilter , AgentFilter & " And " & DateCompletedFilter
Exit Sub
End If

The filter on the agents works and the filter on the completed date of null apeears to work however when a record is completed it diappears on refreshing of the form even though the record has been completed on todays date.I have investigated the code an the issue appears to be with the DATECOMPLETED = #" & Date & "# part of the code.

View 5 Replies View Related

Forms :: Load Form With Max Date

Jul 19, 2013

I'm trying to open a specific set of records when the form is first opened (namely the most recent date that was added). I'm trying something along these lines and am simply unable to get it to work:

Private Sub Form_Load()
Dim strQry As String
strQry = DMax("TranDte", "Transaction")
DoCmd.OpenForm "FrmSalesInp", acNormal, "", "[Transaction]![TranDte]="
& strQry, , acNormal
End Sub

View 5 Replies View Related

Modules & VBA :: DLookup Doesn't Return Correct Value

Aug 3, 2015

I'm trying to use a DLookup to get a specific value from a field in a table.

This is what my code currently looks like;

Code:
JOBID = DLookup("[ID]", "MASTER PLANNER", "[JOB NUMBER] = '" & JOB_NUMBER & "'")

Basically I want to get the ID (a number) from a specific record where the JOB NUMBER equals the string I have typed in to a field on the form, also called JOB NUMBER.

However, my problem is that it doesn't navigate to the record where the criteria matches, it just chooses the ID from the very first record of the table.

what I'm doing wrong?

View 9 Replies View Related

Modules & VBA :: Use DLookup To Return A Value From Relevant Field

Nov 14, 2014

I have a small table, that only contains one record (and should only ever contain one record, which simply gets edited to suit once in a while).The table is called OtherRates, and the fields are as follows:

WRD_Sat/Sun/BH
WRD_Mon-Fri
AHDifferentia
SKDifferentia
Sat/Sun/BH_OTRate
Mon-Fri_OTRate

I am trying to use DLookup to return a value from the relevant field in this table, however the field to look in is a variable.The code (below) that I have tried returns an error and highlights the DLookup line,.

Code:
Dim WRD
Dim DayType

[code]....

View 3 Replies View Related

Forms :: VBA To Load New Form Navigation Buttons?

Sep 5, 2014

I need to execute some VBA to load a new form in my navigation view, not a popup form.

If use DoCmd.OpenForm "DB History" it opens the form as a new form.

DoCmd.BrowseTo acBrowseToForm, "DB History" set the focus on the DB History navigation button but doesn't open it.

So I think I need to add the path.

'DoCmd.BrowseTo ObjectType:=acBrowseToForm, ObjectName:="DB History", 'PathToSubformControl:="??"

This is where I am stuck.

My main form is Navigation Form1

The sub ins NavigationSubForm

and the form loaded is Form1 which I would like to replace with DB History

View 5 Replies View Related

Forms :: Add Default Text To Form On Load?

Jun 22, 2015

Is there a way to add default text on a form when it loads via vba?

I have a form (frm_add_targets), which has 15 fields on it and I would like to add default text to these fields if the field should be null.

For example: one of my form fields is called: w_text1 and I would like to default the value of this field to the following: Significant amount of revenue at risk 1)<50k,2)up to .5mil,3)up to 3mil,4)up to 5 mil,5)>5 mil should it be empty on load,

View 4 Replies View Related

Forms :: Search Form To Be Empty On Load?

Jun 28, 2013

I have a form which is for searching for and then viewing a record based on a text box and pressing enter. This is working fine. My ID field is 4 digits and when I change the 4 digits and press enter it shows me the details for the record in all of the other boxes:

Private Sub txtJobID_AfterUpdate()
If (txtJobID & vbNullString) = vbNullString Then Exit Sub
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone

[code] ....

My question is, as this is not a data entry / additions / deletions form (I have editing and filters to yes though) How do I get it to load empty? Not on a new or blank record but empty until I have typed my 4 digits. Just to clarify, my txtJobID box is empty on load but all of the other fields show the first record.

View 3 Replies View Related

Forms :: Load Textbox From Selected Value From Another Form?

Jan 16, 2014

i have employee form to insert employee information one of its text box on click another form open of schools name where i can select the school work how can i pass selected school name to the main form

View 2 Replies View Related

Forms :: Form Load Calculation Not Working

May 12, 2015

I have a bound form to an invoices table. The form details all invoices raised, all payments made and an outstanding balance. The outstanding balance control is just a basic text box.

On form load, I go to the payment table and select all payments into a recordset, I then add up all payments and use the following calculation:-

Balance = InvTotal - paytotal

The Invtotal is the control on the form that has it's control source set as sum(invoicetotal)

The calculation used to work and the correct balance was displayed, indeed, for one particular client, the calculation works, but for all others, the summed value is blank and so the balance is effectively set to the paytotal value.

I know this is to do with the timing as the form loads and it's records/data are made available, as I have an update button that does exactly the same things as the form load and when pressed, all numbers work.....primarily because the summed invoicetotal value is now available in the form control.

I can see what is happening, but not sure why...I thought that form load gave you all records and would have populated the summed control before triggering the load event....obviously not.....

View 9 Replies View Related

Modules & VBA :: DLookup To Return A Value Starting With Specific Letter

Feb 25, 2014

I am trying to use a DLookup to search to find what block goes into the production of an item.

In a table called "dbo_vw_MCE_job_with_materials", each item contains a list of the parts which go into its production in a column titled "Expr1". However there are always more than one parts to this, with varying names.

What I am trying to do is to use a Dlookup to only return the first value which starts with B (as the block number is always the only part on the list which begins with B).

At the moment my DLookup would look ike this:

Code:
MixTypeTxt = DLookup("Expr1", "dbo_vw_MCE_job_with_materials", "[item] ='" & Forms![Theta Input]![ItemNumbertxt] & "'")

However I think as the item column contains the same item number in 8 columns, with different values in the Expr1 column, Dlookup only returns the top value "A-CF0057" (which is irrelevant as far as I am concered) - whereas I am hoping it will be able to pull the "B1499" value from the column as it is the only one starting with a B

Is there anyway to specify which value the dlookup function would return, or is there any way to apply some sort of permanent filter on my table?

View 1 Replies View Related

Modules & VBA :: Multiple Criteria To Return Value - DLookup Error

Feb 11, 2014

I have been trying to find a solution to why I can't get a Dlookup with multiple criteria to return the value I need.

Essentially I am trying to use an Order Number to find the item number which is contained within another table. However the order number has multiple lines (suffixes) which alter the item number. Therefore I am trying to have the item number be populated by the correct 'combination' of Order Number and line ("suffix").

I have managed to use the Dlookup in the after update of each box of the form separately and they retrieve values in the table correctly:

Afterupdate of main order number:

Code:

Private Sub OrderNumbertxt_AfterUpdate()
ItemNumbertxt = DLookup("item", "dbo_job", "[job] = '" & Forms![**INPUT]![OrderNumbertxt] & "'")
End Sub

Afterupdate of suffix:

Code:

Private Sub SuffixTxt_AfterUpdate()
ItemNumbertxt = DLookup("item", "dbo_job", "[suffix] = Forms![**INPUT]![SuffixTxt]")
End Sub

However when I combine them as follows in the afterupdate of the Suffix box I receive a "Run-time error '13': Type mismatch"

Code:

Private Sub SuffixTxt_AfterUpdate()
ItemNumbertxt = DLookup("item", "dbo_job", ("[suffix] = Forms![**INPUT]![SuffixTxt]") And ("[job] = '" & Forms![**INPUT]![OrderNumbertxt] & "'"))
End Sub

I think the reason is something to do with some being numbers and some being a combination of text and numbers (based on the replies of other topics), but have been trying to modify these slightly and can't get it to work still.

Also the Order Number is a combination of letters and numbers (normally in the form of AB12345678), the suffix is just a number between 0-9 and the Item number it finds is a combination of numbers and letters.

View 3 Replies View Related

Queries :: DLookup To Return Value Of Field In Query Expression

Oct 30, 2013

I have a field created in a query expression

BirthMon: Format([DOB],"mmmm")

I would like to create another field in the query using DLookup to return the value of the BrithMon.

BrithMonthID=DLookUp("MonID","tblListMons","BirthM on = Mon")

This works good if used with an unbound text box on a form, but when entered into a query expressions, an error is returned: cannot find the name 'BirthMon'

Can I used DLookUp in a Query expression to refer to another Query created field?

View 2 Replies View Related

Forms :: Form Is Changing Data On Load And Close?

Feb 8, 2014

I have designed a form using the wizard from a table which records transactions for an entity.

I have a Primary Key (auto number), entity id, transaction amount, description and date fields in the table.

I look up the entity using a list box, then populate unbound fields then use CurrentDb.Execute "INSERT INTO in order to save the new record.

When I open the form for use, it automatically changes the entity id of a previously added record to the most recently selected entry in the list box. I am unsure why it does this. It seems to be editing previous records when you change the value of the list box.

View 8 Replies View Related

Forms :: Recordsource - Slow Form Load Event

Mar 9, 2013

I've got a DB, which has 3 forms ( all 'under' 3 navigation buttons/tabs ). The main form ( Client's form ) is set to show first, and currently has a recordsource of about 1350 records. I think the size of the recordsource, and the fact it 'loads' the other two forms all 'in one go', is slowing it down ( between 5 and 10 secs. to load ).

I read I should set the Visible properties of forms, not shown immediately, to false, only setting them to True in the On_Load event - when Tab is selected. Ideal I thought. However, I can't find this property in the Form's property sheet.

View 1 Replies View Related

Forms :: Not Empty List View At Form Load

Oct 29, 2013

I have created a form with a list view (active-x) to be able to control colors, etc in a list.

When I open my form, it is already information (three rows) in the list view. This despite the fact that I have shut down the access application and even shifted the database to another computer.

I can of course delete the elements with ListItems.Clear when I open the form, but I'd rather like that they did not show up at all.

Where these "default-elements" are stored, so I can remove them from the list view once and for all?

View 6 Replies View Related

Forms :: How To Load Blank Form Before Combo Box Selection

Feb 14, 2014

I have a form that I populate after making selections in two combo boxes but when I load the form the text boxes are already filled in with the first record. The combo boxes load blank, which is what I want.

How do I get the rest of the form to be blank on load? It is made up of text boxes and check boxes that are all bound. Will this only work if they are unbound?

View 7 Replies View Related

Modules & VBA :: Multi Criteria DLookup - Return ID Number Of Entry

Dec 4, 2013

I am trying to make a DLookup function to return the ID number of an entry that matches 2 or 3 criteria but I am struggling to get the syntax correct for the second and third criteria.

Here is what I have so far:

1 criteria, works fine =DLookUp("[timedata]![id]","timedata", "[processdone] =" & Forms![Mainform]![p11] )

2 criteria, works fine =DLookUp("[timedata]![id]","timedata", "[processdone] = " & Forms![Mainform]![p11] & " And [timedata]![BGSnum] = 1001" )

BGSnum is a numerical value but it changes for each form I load, so what I want to do is use the form location value as the criteria.

E.g.

=DLookUp("[timedata]![id]","timedata", "[processdone] = " & Forms![Mainform]![p11] & " AND [BGSnum] = ' " & Forms![Mainform]![BGS] & "' ')

and possibly a third criteria too. This is where I am having problems and the syntax is wrong so MS Access wont let me save the macro.

View 6 Replies View Related

Forms :: Datasheet View - Specify Ribbon To Open On Form Load

Aug 11, 2015

When you open a form in datasheet view, the default ribbon is of course the "Datasheet" tab. I would rather have the "Home" tab ribbon open up, because I have one field in this form set up as hyperlinks to open another form, so the filter and search buttons would be more useful to the user. I'd rather not go to the trouble to create a custom ribbon, so is there anyway to set the default ribbon tab to "Home" when you load the form? There is a ribbon property for the form, but I don't know the reference name for the tab.

View 5 Replies View Related

Forms :: Enable / Disable Navigation Button On Form Load?

Mar 25, 2013

Basically I want to put a code in the "on load" event of a form that enables or disables navigation buttons based on a value in a table (the table has 1 record and 1 column).

So if the value is "A", I want to hide navigation buttons on load; if it is "B", I want to show navigation buttons on load.

I know I can set this property in each form, but I have a number of forms that I want to configure at the same time.

My problem is that I don't know how to reference the value in the table.

View 3 Replies View Related

Modules & VBA :: Return Single Value From Table And Assign It To String - DLookup Not Working

Sep 3, 2014

I am trying to return a single value from a table and assign it to a string to be used later but Dlookup isnt working at all. below is the code im using and the error message im recieving is "wrong number of arguements or invalid property assignment"

Code:
Sub boo()
Dim result As Integer
result = dlookup("Definition", "Config", "Parameter = 'Mail Folder'")
End Sub

View 13 Replies View Related

DLookup Function To Load Information From Table To Another Table Using Subform

Mar 22, 2013

I have 3 table table; Invoice table, Product table and Sale_product table. Sale product table records all sale from the product table

Invoice table has these fields
ID
TOTAL
CASH_TENDERED
CHANGE

Product table has

ID
CODE
QUANTITY
NAME
PRICE

and Sale_Product table has these
ID
PRODUCT_CODE
QUANTITY
PRODUCT_NAME
PRICE
SUBTOTAL
INVOICE

I did main form from Invoice table and sub form from Sale_product table. I want to use DLOOKUP function to load the name and price, quantity and calculate subtotal automatically from the product table based on the product code entered. i have being trying hard and i keep on getting "Name? error"

View 1 Replies View Related

Forms :: Setting Popup Reminder On Form Load For Expiry Date

Jul 26, 2015

I have a form (Access 2010) in which i insert contracts; each contract has a start and an expiry date, but instead of dd/mm/yyyy i would like the user to be able to insert just the year, while the day and month are predefined values and they are automatically inserted (i.e. 01/10/yyyy; the year being the only value that changes, and it is manually inserted by the user).

I would like to set a pop up remainder (on form load) x days before the expiry date, but, because too many of them have the same expiry date i am wondering if the reminder can be set on different days, based on another field (i.e. partner location [country]).. i.e. reminder for contracts with Austria to pop up 60 days before expiring, for UK = 67 days and so on.. or even a specific day for each, i.e. for Austria = 01/08/yyyy, for UK 01/09/yyyy).

View 2 Replies View Related







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