Forms :: Button Not Calling Correct Instruction?

Jan 22, 2015

i have a form that pulls in a subform specific to the CurrentUser(). It is meant to be a shortcut or favorites form that holds 8 command buttons. I have Dlookups on the form to pull the correct fields from a table for OpenForm or OpenReport and then the name of the form or report they want to open. My froms work but when i try and open a report, it just prints the (correct) report and does not open it. I just want to open it.

Private Sub cmdBtn1_Click()
If Me.btn1Action = "OpenForm" Then
DoCmd.OpenForm Me.btn1Details, acNormal, , , acFormAdd, acWindowNormal
Else
If Me.btn1Action = "OpenReport" Then
DoCmd.OpenReport Me.btn1Details, acViewNormal, , , acWindowNormal
Else
End If
End If
End Sub

View Replies


ADVERTISEMENT

Modules & VBA :: Calling RDL File To Generate Reports From A Form Control Button In Access

Dec 2, 2014

So Access was unable to manage the amount of content that I needed to produce in a single report. The reports contain 12 charts/graphs all of which I needed on separate pages (one chart per page). As such I could not create large enough charts in access to fit to each page, as Access limits the amount of space one can use in a report.

I downloaded Microsoft Reports Builder 3.0 and built my reports as needed and can generate them as desired at current. I'm wondering if there a way to call that RDL file I created to generate my reports from a form control button in Access?

View 3 Replies View Related

Correct Code Command To Keep Form Open After Selecting Close Control Box Button?

Oct 13, 2015

I am at my Login Screen, I want it to return to the Login Screen if you select "NO" and Close the DB if "YES"

Here is my current code:

Private Sub Form_Close()
If MsgBox("Would you like to EXIT the Database?", vbYesNo, "Quiting Database") = vbYes Then
Application.Quit
Else
???
End If
End Sub

View 5 Replies View Related

Subform Correct Answer Adds To Number Correct In Main Form

Mar 2, 2012

The code I have is.

Code:
Private Sub Command26_Click()
If Forms![test site]![prp test].Form.[A Right Answer] = -1 Then
Forms![test site]![number correct] = Forms![test site]![number correct] + 1
End If
DoCmd.FindNext
End Sub

Then when clicked it checks a yes/no box to see if "A right Answer" is the correct yes. Then it should pop to the main form and take the number correct cell and add one to it. I am trying to get the record to go to the next record inside the sub-form but docmd.findnext seems to be wrong too.

View 4 Replies View Related

CASE Instruction

Jun 28, 2005

Hi everybody,
I'm having quiete a problem with the case instruction. I have the folowing query:

Select station, count(case poc_1 when 1 then 1 end), count(case poc_1 when 2 then 1 end)
From poc
group by station


Well Acces tells me there is a syntax error in the case instruction???Can't find!!!Can anybody help? Tanx

View 4 Replies View Related

How To Run Instruction Stored In A Memvar??

Mar 10, 2005

I'm used to doing the following with Foxpro:

mSetup = "Replace table.desc with alltrim(table2.code)+" ~ "+table2.vno+" ~ "+table2.po+" ~ "+table2.vendor

To run the process I use a macro substitution:
&mSetup

What can I do as an equipvalent with VBA??

Thanks in advance,

Steve

View 1 Replies View Related

How To Run A Command Prompt (MS DOS) Instruction From A VB Code

Jul 18, 2007

I want to run the following MS DOS instruction using the VB code:

cd
copy C:WorkingAreaTmpPDF.pdf C:

without showing the command prompt screen?

Is it possible to pass this command using VB code statement?

Thanks

View 3 Replies View Related

Forms :: How To Switch To Correct Record When Switching Forms

May 7, 2013

I have a form called "Customer Details", on that form i have child forms, including one that has a schedule on.. so far everything seems fine, am able to get it to pull data correctly to the correct fields.. etc

I'm using 1 main table for all of this called "Cases"

Now the problem is, when i i click a button to print (this works so far), it opens another form and then fills in all the textbox's, however this is where i've got the problem, as it always seems to pull the data from the first record, not the record that i'm currently on..

so for example, if in the customer details, someone looks up "joe Blogs" using the navigation search and then wants to print it, by hitting the print button .. it should open another form, fill in the boxs and print "Joe Blogs", however it's always doing "Joe adams" - 1st Record

View 2 Replies View Related

Forms :: DLookup For Saving The Correct Value

Jun 4, 2013

I have an old Access 2000 database which needs some functionality update, and I can't get things working as they should.

The issue is related to frmOrderDetails form based on tblOrderDetails table, with following fields:

Order_ID
Product_ID
Ordered_Quantity
Product_Price

For entering ordered products there is a combo box for Product_ID which is displaying information about available products, their stock level, and price.

The Row source for Product_ID looks like this:

Code:
SELECT DISTINCTROW [qryStock4Orders].[Product_ID], [qryStock4Orders].[Product_name], [qryStock4Orders].[Available_quantity], [qryStock4Orders].[Selling_price] FROM qryStock4Orders ORDER BY [qryStock4Orders].[Product_name];

qryStock4Orders holds the calculated values of stock level (Available_quantity) for each product, grouped by Product_ID and Selling_Price. Selling_Price is from tblX.

Because I can buy one product from different suppliers (for different purchase prices) and purchase prices (so selling prices too) of the same product may vary over time, qryStock4Orders may list more then 1 available Selling_Price for that product, for example:

Product_ID Product_name Available_quantity Selling_Price
123 Product xyz 12 25$
123 Product xyz 42 29$
123 Product xyz 8 30$

What I want to achieve is to turn this code placed on After Update event of Product_ID combo box

Code:
Dim strFilter As String
strFilter = "Product_ID = " & Me!Product_ID
Me!Product_Price = DLookup("Selling_Price", "tblX", strFilter)

in something usable, in order to save into tblOrderDetails the selected Selling_Price and not one random Selling_Price from the 3 available above.

As the stock level is updated only after Ordered_Quantity and Product_Price are entered manually, what I'm trying to do with the code above is to automate the data input into Product_Price field of tblOrderDetails.

View 3 Replies View Related

Correct Forms Functioning In Access 2000

Sep 28, 2006

Hi,

I have a problem with making a (simple!) search form work in Access 2000. I wrote the code in (what i believe to be) Access 2000 version, and it runs on my machine that is Access 2002-3. The search form uses VBA code; an if-then logic for 3 fields that are chosen by the user, and discounts fields that are not selected. The code then filters results from a query based on 2 tables and presents these in another form.

This all works fine on my pc, and on others using Access 2002-3, with macro security set at medium (and macros approved to run). However, the search form does not work on pc's running Access 2000. I do not know the security levels for these pc's but please if anyone knows of what may be causing this... please help!!

Thanks,

KC

View 3 Replies View Related

Forms :: Form Not Printing Correct Record?

Nov 7, 2014

After data is entered and exit and print is selected, it doesnt print last record in the table

View 7 Replies View Related

Forms :: Have To Open Form Twice To Get To Correct Record

Sep 4, 2014

In the following code to add an article to a purchase order line table and then open the form on the purchase order in question , I had to open the window "frmPurchase" twice in succession. If I omit the first docmd.openform statement, the form would open at the first record in the table, not the one defined in the where clause "PUOpen and PUCompID = " & Me.lstCompany.

I had noticed previously that, when the form "frmPurchase" was already open, Access went to the correct record, and not if the calling program had to open the window, which is why I came up with the idea of replicating this behavior in the code.

With rstC
.FindLast "PULineNB <> 0 AND PuLineHeadingID = " & rstB!PUID
If Not .NoMatch Then
linenb = rstC!PULineNb
Else
linenb = 0

[Code] ...

Is this normal behavior, and if not, how can I improve the code?

View 14 Replies View Related

Forms :: Combobox Selection - Fill In ID And Name In Correct Text Boxes

Oct 19, 2013

I have a combobox on an unbound form. After making a selection, I click a command button which opens a bound form to a new record. What I need to code next or add into the macro, is for the selection of the combobox to fill in the contact id, and contact name in the correct text boxes.

The combobox row source is: SELECT qryPBS.ConID, qryPBS.PBSName FROM qryPBS; bound column 1.

View 1 Replies View Related

Forms :: Must Click Toggle Filter For Form To Show Correct Data?

Jul 26, 2013

I have a navigation form with a combo box. The combo box has a running list of manifest numbers. I select a manifest number, then click a button that brings up a new form with data related to the selected manifest.

However, I have to click and unclick the 'Toggle Filter' button on the new form to show the correct data each time I open the form.

View 2 Replies View Related

Forms :: Adding Links To Files Into A Field - Accessing Correct Folder

May 16, 2014

I have a code to add links to files into a field, I recently migrated from Windows 7 to 8 and the name of the folders in 8 are different; therefore the database I have does not find the linked file anylonger.

To avoid this happening in future, I would like to have the option for the user to set the folder path through maybe a table and then the link will refer to the settings in the table.

Currently I am using the following code:

Private Sub AddLinkDoc_Click()
Dim strFilter As String
Dim strInputFileName As String
Dim varDirectory As String
varDirectory = "C:UsersMarco TagliaferriDocumentsBA CityflyerCrew SchedulerDocumentationDocs"

[Code] ......

View 2 Replies View Related

Forms :: Pass Value From Form To Calling Form

Apr 21, 2015

I have Form A that is bound to tbl_Member (MemberId, LastName, FirstName, and some other fields).

On Form A is a combobox [cbo_Selector]. The combobox shows LastName and FirstName from tbl_Member, but when a name is selected, it returns the member's ID to Form A and causes that member's record to show in Form A (along with other data pertinent to the member). This works fine until I type a name into the combobox that does not exist in the underlying table.

I use the NotInList event of the combobox to pop up another form (Form B) in the DataEntry mode. Form B is bound to the same table as Form A. I enter the LastName, FirstName, and exit Form B. What I am trying to do is to have Form B pass back the new MemberId to Form A and specifically to add that record's data to the combobox on Form A.

I have tried several things to accomplish this. When Form B updates, the table has the new member added, but when I try to requery Form A or the combobox, I get errors. how do I communicate to the combobox in Form A the information from the newly added record?

View 11 Replies View Related

Forms :: Command Button To Unlock And Lock Fields / Edit Button?

Feb 19, 2014

I have created a web-database (? - There are globes over all the forms and tables icons) based on the Issues & Tasks template. This means that most of the data is entered and seen on the "Main" form, which has two tabs - Open Issues and Closed Issues. I have created a form that allows people at my work to input the necessary data and save it, so that it will show up on one of the two tabs. However, once a record has been created, I want to be initially locked if the ID/PK is clicked, so that data can't be changed or entered inadvertently.

SO, I changed the code so that when the ID/PK for a record is clicked, it brings up a different form, but one that looks exactly like the one that is brought up when entering a new form, but I locked all of the fields so that the information cannot be changed. It seems from what I have read that I can create a button on this form so that when clicked, it unlocks the fields on the form so that they can be changed, and then when clicked again it will lock the fields again. Is this true? If so, how can I do it? Or is there something similar I can do? I have seen codes that I could copy and paste, but I cannot figure out the place to copy and paste codes in Access 2010.

I have changed the Form properties so that Data Entry and all the "Allows" are set to No...

View 9 Replies View Related

Adding Instruction Text In Text Box?

Nov 3, 2004

I've looked around and check the help file, I'm sure I'm probably not looking for
right thing here.

What I want to do is include text in the text box that would appear prior to the user
typing in their text.

So say I have my text box and in it appears <Type E-mail message body here>.

Then when the user clicked in the box to type out their message my instruction message
would either disappear or the user could erase it.

I know this is something simple, I just don't know what I'm looking for here. Sorry for the trouble.

View 5 Replies View Related

Forms :: When Highlighting The Notes / It Appears That You Are Highlighting Correct Text

Jun 12, 2015

We have a bunch of notes that are stored in a database. The program looks for the notes that are relevant to each order, and it adds them one by one to a textbox.In some instances, when highlighting the notes (as certain parts of them are copied by the user) it appears that you are highlighting the correct text, but when the text is copied and pasted, different text was copied to the clipboard (usually a string that is offset a couple characters).

I can't post an image (I haven't posted enough), but highlighting everything in the text box selects what appears to be blank space. I wish I could show you. Maybe I'll get to the needed number of posts and be able to attach the screencap.

View 7 Replies View Related

Calling Database

Jun 22, 2005

This is my first time using access and got it to work for a blank database.

The problem I ran into is how do I call for the form in the database from my desktop

I tried a shortcut but it does bring it up but i still have to click on the form to open it

Is there a way to make a shortcut on my desktop to open the form

THXS Steve

View 4 Replies View Related

Calling History

Jul 13, 2006

Hi. I am creating a contact management database. Also I am new to Microsoft Access. How would I create a calling history record for each of the clients in the contact database? What would be the best way and how would I go about it? The calling history ideally would include the call recipient, time, date, subject and notes. Thanks. Take care.

View 1 Replies View Related

Calling A Query Thru VBA

Jun 19, 2005

Hi All
Nice to find a forum which helps ppl new to VB access 'like me' :). I appreciate any help in this regard.
I generated a report from a query. I would like to modify this report by adding parameters pertaining to 'another' query (say query num 2). There is no relationship between these two queries. How do I call the 'other' query (query num 2) thru VBA and modify its parameters.

Thanks alot in advance

View 1 Replies View Related

If Statement Calling Msg Box

Jun 30, 2005

I have a series of IF statements that check my fields and if null call a message telling the user a value must be filled in before the record cab be saved. The code works fine. Here is the code for two fields to show the syntax:

If Len(Me.FName.Value & "") = 0 Then
MsgBox "You must enter a value into FName."
Me.FName.SetFocus

ElseIf Len(Me.LName.Value & "") = 0 Then
MsgBox "You must enter a value into LName."
Me.LName.SetFocus

This same code repeats for each field.

Here is my problem. I have Home, Work and Cell phone fields. The client may not have these numbers. I want to add code that add code for these fields that calls a message box with 2 command buttons(yes & no) with the Message" Does the client have a Home Phone?"

The user would choose the yes or no command button. If the user chooses yes then the same code as above would be called. if he chooses no the ElseIf statement would be called. Can this be done? I don;t know how to wriye the code for the command buttons. can anyone help?

View 14 Replies View Related

Calling A Query From VBA

Jan 26, 2006

Hi,

I'm having problems calling a simple query from the VBA associated with one of my forms. The code goes thus:

Private Sub Form_Current()

Dim rs As Recordset
Dim db As Database
Dim qryMaxAlp As QueryDef

If Me.NewRecord = True Then
'query database here and find out next alp_key
Set db = DBEngine.Workspaces(0).Databases(0)
Set qryMaxAlp = db.QueryDefs("qryMaxAlpKey")
Set rs = qryMaxAlp.OpenRecordset()
Else

End If
End Sub

The problem occurs on Set qryMaxAlp = db.QueryDefs("qryMaxAlpKey") where I get the error "3265 Item not found in this collection". However the query does exist, and when I run it independantly works fine (it brings back the maximum primary key of a linked table.

So, what am I missing?

View 2 Replies View Related

Calling Databases, And Paths

May 4, 2006

Hello.

I have a database that runs a fews tasks for me me when no one is in the office as the systems are quicker and the admin work tedeous and boring, yet necessay. The problem Im having is in calling a database. The problem stems, i think, from the names on the folder. Unfortunately renaming isnt an option because its got many hundreds of users on the server and I dont have the admin rights besides.

The error is coming on .......

Call Shell("msaccess u: eam-shared-dataRes. SalesOutsourceOutsource_DbsDatabase_StoreOutso urce.mdb").

The error message I get says that u: eam.mdb isnt valid .... when its not. The error is caused presumably by the " - 's " and probable after it passes this the " Res. Sales" will cause an error too. So my question Im asking is, is there anyway to make the path read in full, I've tried preceeding with < and ending with > and "" or even ' but still no joy. Can anyone please help, its getting annoying now. :o :confused:

View 5 Replies View Related

Calling A VBScript In A Directory

Oct 21, 2006

Hello, I have a VBScript that when clicked on opens the command prompt and fires code to upload a query to my website.

What I would like to do is place a command button on my form that will call the script to run instead of having to go and click on it.

I have searched, maybe using wrong terms, but havent been able to get the right code to do this

any help to call this script from a command button would be appreciated.

View 2 Replies View Related







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