Duplicate Record Command Button Not Working For One Form But Is Working For Other Form
Jan 15, 2015
I have an Access 2010 database with two tables and two forms. The tables are Organizations and People. Similarly, the forms are Organizations Entry Form and PeopleEntryForm. The People are linked to the Organizations table. Several people can be linked to the same organization.On my Organizations EntryForm, I created a command button to duplicate a record using the wizard. It works fine.
I did exactly the same thing on the PeopleEntryForm, but instead of copying the record, it creates a new blank record. I don't get any error messages. Is my problem due to the fact that the People table is linked to the Organizations table?
I have two command buttons in a subform "sbfScoutRegDetails", one that launches a report and the other attaches the report pdf to an email, associated with the record ID when clicked.
Both of these buttons work fine when just the subform itself is open, but when viewing it in its main form, I get a window saying 'enter parameter value' for "Forms!sbfScoutRegDetails!ID" (this is the WHERE condition in the macro).The report then opens with all the record information blank.The full WHERE condition
Code:
[ID]=[Forms]![sbfScoutRegDetails]![ID]
Not sure if it's because of using a continuous form as a subform? I need the user to be able to view/print or email a contract to each group/contact that signs up.
I have a cancel button on an add new record form and its not working for some reason. When I press cancel it prompts if I really want to cancel and when I press yes it cancels the record creation BUT it adds a number to the recordID autonumber as if one has been created. Is there anyway to stop this? Here is my code
Option Compare Database Private Sub Cancel_Click() On Error GoTo Err_Cancel_Click If Me.Dirty = True Then
I was trying to incorporate the changes suggested by a member of this forum into my Form. I opened the Form in Design View. I clicked the Command Button and placed the mouse at the insertion point. The command button also appeared. Thereafter, nothing happened. Earlier, whenever I placed a command button, it asked for action to be performed in relation to that command button. But now nothing happens and I don't know what to do. Please tell me how I can bring back the feature. Thanks.
I just created my very first db... I used the wizzard to create it most of it, including command buttons that permit you to move from the one form to another form/report. I saved the db to a shared drive (two people total accessing/updating it) only to find that the command buttons don't work for her. I created the db in 2003, but she has 2007. If I upgrade to 2007 and convert the db, could this solve the problem? THANKS!!
I have created an accdb file and saved as an accde file. The accde file opens with a form with command buttons. But the commands buttons do not work with the accde file (they do work with the accdb file). How do I get them working.
I have a continuous form in which I put a command button for each record called "detail". I would like to click on the "detail" button and make it open another form containing all (and only) the info on this record.
At first I refused to use an "id" to link both forms, but finally I added the "id" in the table... however still does not work.
continuous form: "04 - GASTOS_BUSQUEDA" id field on continuous form: "Gastid"
pop-up (details) form: "GASTOS_EDITAR" id on pop-up (details) form: "editar_id"
This is what I have tried on the "click" properties of the "details" button field (called "btn_editgs"):
4) Private Sub btn_editgs_Click() On Error GoTo btn_editgs_Click_Err Dim strWhere As String strWhere = "[editar_id] = " & Me.Gastid DoCmd.OpenForm "GASTOS_EDITAR", , , strWhere btn_editgs_Click_Exit: Exit Sub btn_editgs_Click_Err: MsgBox Error$ Resume btn_editgs_Click_Exit End Sub
I have a form that opens from a different form based on the primary key within the original form. Unfortunately it seems to be opening a new record every time I open the form--not only from the original form but also straight from the sidebar.
The command button that opens the second form from the first uses the following VBA:
This exact coding worded perfectly in a similar set of forms that I had created; the only difference is a change in the form name & primary key field.
Add onto this, I think that the code DOES work, but then it immediately opens another new record. When I open the second form from the command button, then change to Design View, the form's Filter property is set to [Event_ID]=X (where X is the proper key from the first form) and Filter On Load is set to Yes. The X in the Filter changes accordingly when it changes in the first form. Also, every time I open the form a new record is added to the underlying table.
I've tried setting "Allow Additions" in the second form to No, but then when I open the form nothing appears. Literally; the entire form is blank, no labels, textboxes, combos, buttons or anything. When going to Design View it's still all there.
I've also checked the On_Load, On_Current & Form_Current events and found nothing. I even deleted them and the problem still occurred.
Ok so I have this form that has two subforms on it (sf1 and sf2), these are run by one query called 'test'. Below screenshot of what i dont want happening;
Now what i want is a distinct command for the 'Document Number' column so it cant be shown more than once. basicly i want it to look like this (http://i5.photobucket.com/albums/y152/greyowlsl/This.jpg)... what do i do?
The form is based on a query but still writes directly to the appropriate table.
In the header of the form I have a series of command buttons - new record, navigation buttons, and buttons to open new forms. None of them work at all.
I checked each button to be sure the On Click Events still had the right Event procedure, and they do.
for example, the command button to open the Cases form has the following VBA (generated form the button wizard.):
Private Sub cmdOpenCases_Click() On Error GoTo Err_cmdOpenCases_Click
Dim stDocName As String Dim stLinkCriteria As String
When clicked, the button just blinks - nothing happens. I check to be sure the form isn't a popup and also closed it after clicking it to see if maybe frmCases had opened behind the current form for some reason. Nothing - it's not opening at all.
The scenario is... also apologies if this seems a lot. Simple really.
An edit button on a subform is to open a separate form for editing, and I obviously want to apply a where condition to display the relevant record. So I have
The Record Source for editReviewPEST uses an INNER JOIN...
SELECT Reviews.Year, Reviews.ReviewID, Reviews.LesseeID, Lessee.DateOfOrigSanction, Reviews.Exposure, Reviews.ExpoCurrency, Reviews.SentToCredit, Reviews.Approved, Reviews.Completed, Reviews.Comments, Reviews.LevelOfLastSanction, Reviews.CreditManager, Reviews.TypeOfReview, Reviews.DateOfLastCreditReview, Reviews.DateOfNextCreditReview FROM Lessee INNER JOIN Reviews ON Lessee.LesseeID = Reviews.LesseeID WHERE (((Reviews.LesseeID)=[Forms]![Reviews]![SelectLessee])) ORDER BY Reviews.ReviewID DESC;
So I get the form to open with all the records relvant to the lessee, but to filter it further to exact ReviewID, I thought I could include ReviewID=Me.ReviewID (an Autonumber PK) as the Where Condition to the DoCmd.OpenForm. Instead I get a form which looks like Add Record Form.
I am in trouble with the shell ocmmand,i have a text box "ExcelPath Location" in which there is a path of excel file i am using below code to open the excel file but it gives an error:
Code:
Private Sub Command11_Click() Dim str As String str = ExcelPathLocation.Value strPath = Dir(str) Shell "excel.exe" & """" & strPath & """", vbNormalFocus End Sub
Guys I have just been asked to take a look at an old DB that I did ages ago. The problem relates to the Suppliers Form. It has a SubForm SupplierContacts.
The user can enter a supplier contact name for the supplier account being viewed. If they navigate away from the record and then back the Supplier Contact form is blank? I can't see why this is happening. Been playing around for a while now but still can't see it?
Master / Child Link is OK: SupplierID to SupplierID
The record exists within the main table (tblSupplierContacts)
Hi, I have a sub form (courses). which isn't displaying the information that i have previously entered into it for a particular record.
i.e. I have an appointments system where the my main form 'Tutors' links to a 'courses' sub form. I can enter info into the courses form through the tutors form but when i close it and then reopen at a later time the information for courses isn't displayed for the record which i had previously entered it for. (it is in the courses table though, i've checked).
I am running Office 2003 with the latest updates on XP Professional SP2, again with the latest updates. The install was fresh only about a week ago, and I had only used this install of Access for a few hours before it started doing it!
I have tried creating a totally new database, or using an existing database, and the same happens. This led me to believe it was my Office install. I tried doing a repair through add/remove programs, which successfully repaired Office apparently, yet the problem persists. I even totally removed Office, rebooted, and reinstalled, and tried without updates!
Maybe this should be posted under VBA.... not sure. Havent seen answer that works yet. Its a form with an option group "PickWO" When you pick an option, different fieilds become visible-non visible. I created a field "PickWOvalue" to store the option value "1" or "2". That part works fine.(visible) The problem is when you reopen the form to view the records the option box value does not show or change the fields visible properties. And the on open cuauses an error. Anyone see the problem?
Private Sub Form_Open(Cancel As Integer) Me.PickWOvalue.Value = Me.PickWO.Value End Sub ````````````````````````````````````` Private Sub PickWO_AfterUpdate()
Call NotVisible
Select Case Me.PickWO
Case Is = 1 Me.ReInspectionDate.Visible = True Me.Price.Visible = False Me.WOPreview.Visible = True Me.PrtWO.Visible = True Me.WBMInvoice_.Visible = False
Case Is = 2 Me.ReInspectionDate.Visible = False Me.Price.Visible = True Me.cmdPreTag.Visible = True Me.cmdPrtTag.Visible = True Me.WBMInvoice_.Visible = True
Hi group, I am a newbie to Access and VBA programming. My original post was probably not very specific as it was not answered but I really need help on this!
TABLE1 stores a list of serial numbers and a status field (it contains the word Pass or Fail). The NEWSN table is used to capture new input of serial numbers and a field to indicate if the serial number exists in the first table.
The query based continuous form used to enter the new serial number. Upon entry of the new serial number the form requeries to find the match. If a match is found the remaining fields on the form populate correctly. If no match is found the form does not show the input of this serial number, but it does write the new serial number to the NEWSN table.
How can I get it to keep the new serial number showing on the continuous form and insert a statement into the NEWSN table indicating "No Match"?
Hi- I am trying to create a Registration form for Events and I'm having endless trouble getting it to work. Basically, I have four tables: Contacts, Registration, Payments, and Events.
I either cannot delete registrations when I need to-I delete a record in the form, but when I reopen it it is there again; or the pmts table is adding blank records. So when I try to create a query to get a list of registrants, I will get two fields with the same name and Reg Id, and one with a pmt and one without. I want one record per person registering and Im not getting that in my database.
Most, but not all, people are paying for events. Some people are staff or scholarships. I want to be able to see just one record for every person who has registered, whether they have paid or not. Im either seeing two records with the same reg number, or missing people that have not paid.
I have tried all kinds of configurations as far as relationships and Reg form and Im pretty stumped at this point. Any help would be greatly appreciated!
I posted a thread on here a few weeks ago about dynamic queries. I was recommended to use Query By Form. So I went to the Microsoft website, followed the instructions, but now it's not working. The query is returning ALL of the table records, no matter how many fields I fill in (or what I fill them in with). I think something may be wrong with the Query criteria, but I typed it just like the site said. If anyone has experience with this, any ideas what I'm doing wrong?
Form has 15 fields (all are related to a field in the table). 3 are combo boxes, the others are textboxes.
Here is the directions I used: http://support.microsoft.com/kb/209645/en-us
I have a form with a text field and a command button. My code works for the password part but it is not checking for the 3 times and exit code. I'm not real up oon coding and not sure what Im missing Any help would be appreciated:
Private Sub cmdLogin_Click()
If txtPassword = "Test" Then DoCmd.RunMacro "Mac_man_main" Else: MsgBox ("Please Renter Correct Password"), vbOKOnly, "Error!", 0, 0 Exit Sub End If
'If User Enters incorrect password 3 times database will shutdown
intLogonAttempts = intLogonAttempts + 1 If intLogonAttempts > 3 Then MsgBox "You do not have access to this database. Please contact your system administrator.", vbCritical, "Restricted Access!" Application.Quit End If
I'm working in Access 97 and I've got a form that I want to use to create filters with.
There are a couple of things that I'm not clear about and I'd appreciate any suggestions that you can make:
1. The form seems to remember the last filter, so when I click on the Filter by form button it shows the last filter by default. I've included the following in the click event: RunCommand (acCmdRemoveFilterSort) Me.FilterOn = False RunCommand (acCmdFilterByForm) Surely either of the first two statements should remove the filter, shouldn't they? and if not then what are they for?
2. I can't get the 'OR' tabs to show at the bottom of the filter by form screen unless I apply the filter once and then click on the filter by form button again. Is there any way of forcing these tabs to appear?
I have a table filled with computer monitor information (tblMonitorManagement). I had query that uses combo boxes (cboSerialNo, cboRoom, cboDepartment) on a form for search parameters. The query is called qryMonitorManagement_Sub. The results are displayed in a subform (frmMonitorManagement_Sub). This works for both my desktop and also my laptop based forms/queries/tables.
Although this form works when using cboRoom and cboDepartment, it does not work when using cboSerialNo, so I decided to simplify it down to get to the root of the problem...here's what I did.
I created a new form, created a combo box (again called cboSerialNo), and had it look up the serial numbers in tblMonitors. Simple.
I created a query called qryMonitors_Test, added all fields from tblMonitors (not using the * option). I then set the SerialNo field criteria to the contents of the cboSerialNo on the new form. Simple. For now I'm ignoring searching on anything else.
I ran the query with no search parameters before I added the criteria, and it obviously displayed all the records in tblMonitors. Fine.
After adding the criteria (using Build...to prevent typos), I used the form to select a serial number, run the query and get no results returned.
If I copy and paste the same serial number and change the SerialNo criteria in the query to search for that it works fine. As soon as I tell it to search for the combo box contents it returns no data.
This is driving me completely bat-poo. It's nothing I've not done a squillion time before but it just refuses to work. I've got to assume it's a query issue as opposed to a form issue, but things don't get much simpler than this should be!
Hi I have a Text box that stores a date of when a problem or query is received on to a customer account, when resolved the date it is resolved is inputted in the next text box as a resolved date. My third Text box then needs to display Yes or No depending if it took less than 28 days to resolve.
Ive used a Text box and DateDiff expression to work out the ammount of days in the control source, Called query dauration then a macro to test if its less than 28 days to display the yes or no. But this is not working days Mon - Fri. Has any one any ideas?
platform : access (adp) / sql server Problem : form filter not executing in subforms
When I goto one of my subforms I can activate the form filter. When executing the form filter no records show up, it just keeps showing my criteria. When disactivating the form filter I receive an error message telling that my view must be misspelled (it's about spaces). My view is called Vw_people , as a record source it works fine so it can't be misspelled.
Is the problem the adp connection or the subform? I don't know
Anyone help please ? I'm still fairly new to ACCESS so forgive me if I'm completely on the wrong track !
I wish to add a control button to a form that will prompt me to enter a date and then calculate and display a date nn (fixed) number of WORKING days in the future.
I've seen some functions suggested in the forum and as I'm unfamiliar with this topic, I have tried putting together some code (see below) related to an On Click event for the button. I'm having syntax problems and have been battling away at this for some time without success.
Suggestions please !
Steve
Private Sub cmdDate_Click() Dim FirstDate As Date ' Declare variables. Dim Number As Integer Dim dtEndDay As Date Dim dtinterimday As Date Dim intcount As Integer Dim lnginterimdate As Long Dim intdays As Integer
Dim Msg FirstDate = InputBox("Enter a date - dd/mm/yy") Number = 20
dtinterimday = FirstDate intdays = Number Do Until intcount = Abs(intdays)
If intdays > 0 Then dtinterimday = dtinterimday + 1 Else dtinterimday = dtinterimday - 1
lnginterimdate = dtinterimday
If WeekDay(dtinterimday, 2) <> 6 And WeekDay(dtinterimday, 2) <> 7 Then
intcount = intcount + 1 End If End If
Loop
Msg = "New date: " & dtinterimday MsgBox Msg End Sub