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
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?
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
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.
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
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:
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.
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!!
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?
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.
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.
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"
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?
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...
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.
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.
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.
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?
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.
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 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: