Duplicate Button Fails Me

Sep 23, 2005

Dear friends,

At work, we are developing a database in MS Access to manage the data originating from the archaeological site which we are excavating at the moment. The development work is proceeding rather well considering that none of us has a background in database programming. However, sometimes we get stuck on problems that we seem unable to resolve by ourselves.

For example, recently we encountered a situation which baffles us completely.

Background: Last week we develloped the table and form necessary to handle the decorations present on some of the finds. The "decoration table" is linked to the "finds table" with a one-to-many relationship. They are linked by two secondary key fields called "FindID". They are text fields, size 19, with the following input mask set: LL"."LL"."00?00000?-000. This code automatically appears in the appropriate field of the "decoration form" every time we need to relate a decoration to the record in the "finds table".

Problem: At this point we have a record in the "decoration form/table" related to a record in the "finds form/table". However, sometimes we have more than one decoration present on a find. Thus, we place a duplicate button in the former form to add a second decoration if necessary. This should create an exact copy of the first "decoration form" where, then, we just need to change the type of decoration. This does not happen. The duplicate button creates a second copy of the first form, but it does not duplicate correctly the value present in the "FindID" field. For example: instead of duplicate the "findID" RM.PL05 00534A-001 it inserts it in the duplicated form like RM.PL0500534A-001 (without the space between the 5 and the 0). Thus when we query that particular find, it retrieves only one of the two decorations we inserted earlier on.
One last thing: The code looks the same in both decoration forms, but if I do a query, the above difference appears.
Thanks in advance for your help

Perseo

View Replies


ADVERTISEMENT

Using Create Email Button - Access Fails To Open Outlook

Dec 16, 2012

Occurs when I try using the Create Email button. I've enabled the access add in in Outlook. Same message comes up when Outlook is closed or open.

View 4 Replies View Related

Using A Command Button To Duplicate A Subform

Jul 12, 2006

Hi,

I am by no means an expert... probably demonstrated by this question:

I am trying to use a command button to duplicate the contents of a subform within that subform box. There are five fields that I would like to appear below the five already in existence when the command button is clicked.

Does anyone know how to accomplish this?

Thanks!

View 2 Replies View Related

Forms :: Duplicate Button For Form / Subform

Sep 7, 2013

My programming abilities are mediocre, but not novice.I have a pretty large scale management system to build (more than 40 tables, lots of relationships, forms, etc). One of the structures in the database is the following:

+ Main table
++ Secondary table connected to Main table via FK1.
+++Tertiary table connected to Secondary table via FK2.

The above when making the user interface is expressed as a form (Main Table), a subform (Secondary table) and a subform within the subform (Tertiary table).

I need to create a button that duplicates the contents of the main table, the secondary table and the tertiary table. I have already been able to create a button that duplicates the contents of the main table and the secondary table by using Allen Browne's code found online.how do I move forward to embedding in that method the ability to duplicate the contents of the Tertiary Table?

View 2 Replies View Related

Forms :: Duplicate Record Button To Allow Records To Be Copied

Feb 12, 2015

I have a form with a duplicate record button to allow records to be copied. I used this code (I think from Allen Browne), but it only copies the last record in the recordset?

If Me.Dirty Then 'Save any changes
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record.
MsgBox "Select a record to duplicate"

[Code] .....

View 2 Replies View Related

Compare / Check If Records Are Duplicate Using Save Button?

Jan 9, 2014

I need to create a record of Users. I created a form with fields containing Username,FirstName,LastName & Email Address wherein the UserName is equals the value of the fields FirstName & LastName. I have a save command button and when I click it, I want it to be able to check if the new entry has a similar UserName that exists in the database, if it exists then it will allow me to edit the UserName and then save the data otherwise will allow me to save it.

View 3 Replies View Related

Switchboard Fails In ADP

Jun 14, 2004

After I upsized by Access app to an ADP, the switchboard refuses to compile. When I click any command button, I get an error saying: Method or Data member not found. The error is at the reference to me.switchboardID in the HandleButtonClick procedure. That field is somehow hidden or is programatically created or something. I have tried to import a very simple switchboard from another mdb app with the same results. Something is going on behind the scene's and I can't figure it out. Anybody got any answers?

Thanks in advance.

View 2 Replies View Related

Before Update Save Fails

Sep 9, 2005

Hi, i am trying to perform a beforeupdate event on a record, but seem to be getting an error.

The undo function works fine but it cannot save, i would be grateful if someone can help as the error is unclear.

Code:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If MsgBox("Are you sure you want save these changes?", vbQuestion + vbYesNo) = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Else 'user clicked no
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If

End Sub



Error that i am getting.....

Run-time error '2115'

The Macro or function set to the beforeUpdate or ValidatationRule propety fot this field is preventing from saving the data in the field.

Thanks

View 1 Replies View Related

Subform Requery Fails

Sep 26, 2006

I have used the following command on a command button to requery my subform and it works as I planned. However, if I copy it to say,the OpenEvent for the same form, nothing happens. I'm obviously missing something here. [Forms]![Customers]![mysubform].Form.Requery

All help appreciated thanks

View 3 Replies View Related

Testing For Null Fails

Oct 19, 2004

I have a table where some of the values of MyField are null.

I am creating a function that depends on the value of Myfield which I pass to a variable varMyField and am testing it with If IsNull(varMyVariable) but it errors. Have tried setting the variable as a variant but no difference.

Function Test(varMyField as variant)

If isnull(varMyField) then
Dosomething,
Else
Dosomething Else
End if

End function

Any suggestions please?

View 3 Replies View Related

Form Fails To Update Table

Apr 19, 2005

I have a form which has a table as it's Record Source. The problem lies when a bound combobox or bound textbox is changed, the change is noted on the form but when I reference the value of the object it comes back as null. So I look in the table and the field has not changed. But if I requery the form then it takes.

I've never had this happen to me before, is there something I am missing? :confused:

View 3 Replies View Related

Modules & VBA :: CreateObject Fails In Runtime

May 19, 2015

I am using Access 2010 on Windows XP/Windows 7 My code converts individual lines of address (strings) into a single RTF Address field. It runs fine in full access but (as MS admits) CreateObject does not work in Runtime. Is there another way of doing this that avoids CreateObject??

'create AddressFull
strAddressFull = ""
If Nz(mAddress1, "") <> "" Then strAddressFull = mAddress1
If Nz(mAddress2, "") <> "" Then strAddressFull = strAddressFull & Chr(10) & mAddress2

[Code]....

View 4 Replies View Related

Forms :: Delete Record Fails To Work

Mar 28, 2013

I'm very new to Access, Macros, and VBA. Basically I have a form in ContinuousForm format that has a delete button next to each record. It's been working fine for the past few hours but for some reason Access can't delete the corresponding record(s) (DeleteRecord) now. The button is run by a macro that's made by a wizard.

Also, is there an appropriate way to show code (if that is the term used) for Macros?

View 2 Replies View Related

Access Database Fails When Using Task Scheduler

May 1, 2013

I have an Access database that sends an email to users when there is an exception in the query. It works fine when I run it from Windows 7, but when I use task scheduler I get an error message;

Runtime error 429 activex component can't create object

and the error stops a;

Set olapp = New Outlook.Application

It only happens when i run it from Task Scheduler.

View 14 Replies View Related

ACCDE Fails To Load VBA On Random Workstations

Jan 14, 2014

I have created a database to track leave requests for staff. After upgrading from XP to Win7 and upgrading to Access 2010, some workstations will not run the ACCDE front end, but the ACCDB runs fine.

I am storing the front end ACCDE in C:Users\%username%appdataRoaming which is trusted - and I do not receive a warning for this. When the ACCDE loads I receive the message that "The database cannot be opened because the VBA project contained in it cannot be read.". I have tried running the application with different users to eliminate privilege issues. All the workstations are built from the same image and I cannot find any missing references or different patches. The workstations in question are running RUNTIME version.

I have checked for missing references in the dev version. I have compiled the database right before creating the ACCDE, finally I have run the app with the -DECOMPILE option.

View 3 Replies View Related

DoCmd.OpenForm Fails If Access Is Not The Active Window

Jun 13, 2006

I have an Access 2000 application which, on startup, always launches a 'switchboard' form and sometimes gets information from the user during the startup. Both forms are opened with VBA using DoCmd.OpenForm; the switchboard opens as acNormal and the input form (when used) as acDialog.

Under normal circumstances this works fine.

If, however, the Access window ceases to be the active window in Windows (e.g. the user selects another application's window in the taskbar) the forms do not open (all other VBA code runs correctly).

Any ideas?

Simon

View 2 Replies View Related

Modules & VBA :: Error 3061 - Open Recordset Fails

Dec 1, 2014

The code below fails.

Code:
Dim ResultQy As String, qdf As QueryDef
Dim ResultFm As String
ResultQy = "ByFederationQy"
Dim strSQL As String 'sql statement to execute

[Code] ....

When I run the code it fails at the last line giving error message:

Code:
Runtime error 3061 - toofew parameters expected 1

View 6 Replies View Related

Modules & VBA :: Append Query Fails Due To Referential Integrity?

May 23, 2015

I don't know how to bypass the problem. I have two tables : (1) Dett_Lav , (2) MaterialiConformita.

They are thus linked: (1) IDDett_Lav <---one - to- many ---> (2) Dett_LavID I'd like to preserve the referential integrity.

In vba I wrote down this codethat does work if I delete the referential interity, otherwise it fails due to (foreign) key violation. I do insert the absolutely necessary Dett_LavID with the append query, so I'm not sure where lays the problem and how to bypass it.

Code:
strSQL = "INSERT INTO MaterialiConformita (MaterialeID, DettLavorazioneID) " & _
"SELECT Art_Mate.ArticoloID, Art_Mate.MaterialeID FROM " & _
"((Articoli INNER JOIN Art_Mate ON Articoli.IDArticolo = Art_Mate.ArticoloID) " & _
"INNER JOIN Dett_Lavorazioni ON Articoli.IDArticolo = Dett_Lavorazioni.ArticoloID) " & _
"WHERE Art_Mate.ArticoloID = " & strArticoloID & _
" AND Dett_Lavorazioni.IDDett_lavorazione = " & Me.Parent.IDDett_Lavorazione
DoCmd.RunSql StrSQL

View 6 Replies View Related

General :: Insert Statement Fails With New Number Format

Mar 3, 2013

I upgraded my system to Windows 8 and Office 2013, and it's now 64 bit instead of 32 bit as before. Also note that I'm still using Access 2010 as before.So the following problem now arise in this new config that was not there before.

When you do a calculation like '332.16 - 1', the answer is now 331,16, instead of 331.16. Note the point are now replaces with a comma.

Might sound trivial, but everywhere in my code where is have a dynamic SQL like:

Currentdb.EXECUTE "INSERT INTO Tasks (TaskID, MyNumber)
VALUES ("Tsk123", Var1 - Var2)",

the result was always something like:

INSERT INTO Tasks (TaskID, MyNumber) VALUES ("Tsk123", 331.16), but now it is:
INSERT INTO Tasks (TaskID, MyNumber) VALUES ("Tsk123", 331,16), so it is seen as an extra value and the statement fails.

So, yes I can fix this one statement, but I have multiple occurrences of this throughout my app. How do I fix this?

And changing something in my Control Panel - Regional Settings would not be the answer, as on all the client PC's it might be different.

View 3 Replies View Related

Queries :: Detect When Query Fails To Find A Record

Oct 29, 2013

I have ASSET_TYPE, MANUFACTURER and MODEL tables.

I have a Table ASSET_COMBO that links to the above tables.

I have a form to create amend an ASSETS table. The form uses combo fields to filter the options available to the user. I.E the User Picks Manufacturer then selects from list of Asset Types provided by that Manufacturer, then selects from list of Models.

I want to create a form to allow create and amend records on the ASSET_COMBO Table.

The problem I have is that I want to ensure that there are no duplicates on ASSET_COMBO Table. I know that I can Select Multiple keys from the table with no duplicates allowed. But from what I have read this can cause problems. Is there a simple way that I can detect that a query on the ASSET_COMBO Table has returned a valid record or has not found a record.

View 3 Replies View Related

Reports :: Query Fails To Grab Second Date Criteria Unless Tab Off Of It First

Sep 9, 2013

Before I generate a particular report, the user must input a start and end date. If the user mouses to the generate report button, the query fails to grab the second date that was input. If the user tabs off of it, then it works just fine.

I think I could solve it by requerying the form before I generate the report, but that feels like a bulky work around. Is there a better way?

View 2 Replies View Related

SQL Insert Into Fails - Update Fields That Do Have Data Entered

Dec 14, 2012

The following SQL event will not update the CustomerData table if the FrmContact field on the form is left blank. I have this code in the OnLostFocus Event. Is it possible to have this command update the fields that do have data entered in them even though the FrmContact field is blank?

DoCmd.RunSQL "INSERT INTO CustomerData (CustomerName, CustomerAddress, CustomerCityStateZip, CustomerPhone, CustomerContact, LockRecs) " & " VALUES (""" & Forms!frmflcdeliver.Controls!FrmCompany & """ , """ & Forms!frmflcdeliver.Controls!FrmAddress & """, """ & Forms!frmflcdeliver.Controls!FrmCityStateZip & """, """ & Forms!frmflcdeliver.Controls!FrmPhone & """, """ & Forms!frmflcdeliver.Controls!FrmContact & """, """ & Forms!frmflcdeliver.Controls!FrmLocked & """)"

View 2 Replies View Related

Txt File Field DDMMYYYY Fails To Import Into Access'07, But OK In 2003

Apr 1, 2008

Hi there anyone and everyone.

My problem concerns importing a date from a txt file. I've been doing this for years with '97 and 2003 with no problem, but with 2007 I am now getting import errors which I can't resolve. The files, either fixed width or delimited, contain date information in the format ddmmyyyy (without any date separators). After importing I receive an import error message, and the relevant field in the table is blank.

In Access '97 or 2003 I can import date information directly into an Access date/time field by using an import specification where I have set the date delimiter to blank (by default this is set to "/" , so I simply delete this to leave the box empty). Using this method a file containing "25122007" (without the inverted commas) will be imported into Access as a date, and can be subsequently manipulated as date without having to resort to any fancy reformatting tricks. Obviously the import will not be sucessful if the date delimiter in the import spec is left as "/", or set to anything else, eg "." or ":".

But now that I've updated to Access 2007 this is just not possible no matter what I do or try. I can only import a date if the txt data has a separator, and that the same separator is set in the import specification.


In some new databases I have done a couple of workarounds, importing it as text into a text field, then using a CDate(Format(CLng([date]),"00/00/0000")) type expression in a subsequent query, but this is a pain having to do it, a really backward step.

But the real pain is older databases ('97 or 2003) which have been converted up to '07; they no longer work, and there is a lot of redesign to be done unless somone can tell me what I'm doing wrong.

Unfortunately I am not able to change the format of the dates in the data I receive, so the solution has to come from my end (ie Access). Surely Access 2007 should be able to recognise 25122007 as a date? All ideas gratefully received.

I've been happily using various versions of Access since 1994 and I've learnt lots along the way, and have always previously been able to sort out problems that I've come across without resorting to a forum, but I'm now really puzzled by a problem that I have come across in Access 2007. So although this is my first post I certainly wouldn't call myself a newbie. Hopefully I have described the problem accurately (it is realy simple in fact), but very happy to provide more information if required.

Many thanks (in anticipation)

Benjy

View 13 Replies View Related

Forms :: Main Form With 2 Subforms Fails To Open Current Record

May 12, 2014

I have a main form "frmDriverNoticeRecord" with 2 subforms, "frmSubDriverNotice" and "frmSubVehicleRecord"..The main form uses "IncidentID" as the PK. Each form stores data in its own table. The tables are related via IncidentID and there is a 1-many relationship between tblIncident (main) and tblDN (sub) and tblVehicle (sub).

I have a form "frmIncidentLog" displaying records in a table view with a few fields for quick reference and to allow selection of a single record for detailed viewing. I created a command button with the intent to open the "frmDriverNoticeRecord" at the current record. The main form and child link fields appear to be linked correctly; i.e. IncidentID on all three. If I open the form manually it opens and I can use it and search and filter as I want. If I try to open it via the command button It opens a small window asking for the IncidenID, when I enter theIncidentID number, it opens the form to the first record every time.Here is the code:

Private Sub comOpenDR_Click()

Dim frmName As String
Dim recID As String
frmName = "frmDriverNoticeRecord"
recID = "[IncidentID]=" & Me![IncidentID]
DoCmd.OpenForm frmName, , , recID
End Sub

I tried running the the DoCmd.OpenForm command directly from the button using the where condition (in various manners) with the same results.

View 13 Replies View Related

Function Called Via Auto-exec Fails When Using Access 2007 Runtime

Jan 8, 2013

I am making my very first tentative steps to convert my most complex Access 2003 app to run under Access 2007. There are no obvious problems when simply opening my original MDB file in Access 2007 or running it after conversion to an ACCDB file. However, when I try to run the ACCDB file under the Access 2007 Runtime I get a "You can't carry out this action at the present time..." error. This is then followed by the "Execution of this application has stopped due to a runtime error..."

To be more specific, I only get that error when I deliberately hide the back end database and thus invoke code triggered via Autoexec to allow the user to browse for the missing database. This code works fine when running under normal Access 2007 so it appears to be a Runtime issue.

View 3 Replies View Related

Forms :: Prevent Duplicate Values With Alert After User Enters Duplicate Value

Dec 30, 2013

We are working on an Access (2007) database that is on a SharePoint Site (2007).

Currently the form is operational, but there is one last thing that would be nice to have.

The table is "Updated Headcount" which contains "EMP_ID" which are unique numbers stored as text.

In the event a new employee is entered in the system by another user on this site we would like to prevent any duplicate "EMPID"s from being entered and saved on the SharePoint, we would also like to alert the user and prevent the data from being saved.

All data is currently bound, so once the user makes a change it is made, no submit button is required.

We are running into some difficulties in doing a dlookup from the value entered and comparing to a column in the table.

TABLE - UPDATED HEADCOUNT
COLUMN in UPDATED HEADCOUNT - EMPID
FORM CELL user will input an EMPID - newEMPID
FORM CELL used for a dlookup to compare what user has entered to what is already in the table - duplicateEMPID

So below is what we are trying to do, we are sure there are a few commands missing....

=IIF(newEMPID=dlookup([UPDATED HEADCOUNT]![EMPID]), newEMPID, "Error, EMPID already exists")

View 11 Replies View Related







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