On the form On load event I have code verifying if a condition is true or not. If the condition is true, it does some things, now I want also to rename a form if the condition is true. So, I have created a macro to do this. But if I open the DB for second, third.... time and the condition is still true the macro can't find the specifyed form and brings up an error message wich gives to user the possibility to Debug. This way he has access to the code , and I don't want this to hapen.
Can I do this by using code and keeping the user away from code?
Thanks,
Attila
In the Contacts database, in the Report Center form are 5 links on the right pointing to some default reports.I have created several more reports, and want to just copy-n-paste those links and then change the 'Tag' so it will point to my new report.Can you not just copy-n-paste a field within the same form?
I have only started using acces recently. When working I have used strange names for queries forms and tables. I would like to "clean" the file and rename some items. I have found acces not to rename linked parts automatically. Is this possible? Thank you.
I want to write a code to rename some files. the files names are xxxxxxx01.txt and i want to rename all the files in this directory to 01.txt,02.txt,03.txt can this be done by using VB in access?
Can i rename a control on the fly ? For example, if Me!Office = 6 Then Me.Branch9 = Me!Branch. Both branch9 and branch are fields in the table products
Hi~ First off, sorry about the title; I couldn't really come up with anything that made sense.
Here's what I'm trying to do, I am trying to rename a table in one database from within another (there is a really good reason why I want to do it from somewhere other than the db that contains the object). Here is what I have so far in my code:
Private Sub cmdTest_Click()
Dim strSource As String 'the db that contains the table I want to rename
'Acknowledge security and open SendKeys "NO", True
End Sub
of course I'm missing the part that would rename the object. I guess what I'm trying to do at this point is be able to run the docmd.rename command and have it execute in test1.mdb (the shelled db) as opposed to test2.mdb (the db that contains the code). Is this possible? How?
I've been asked to come up with a way (one-off) of renaming over 100 hundred tables. The table are all called "STUD_ADMIN_blah". We need to remove the "STUD_ADMIN_" part of the table name.
Is there a nice easy way of doing this without having to physically rename each table individually?
Hello, I'm currently working on automating the import of a csv file (which works fine using the Transfertext method) but the csv file does not contain field names.
I want to rename the fields with something meaningful after importing the file, but I can't seem to figure out how to do this using the tabeldef method of handling tables. There's nothing in the help, not that I could find anyway.
Does anyone know whether this can be done and how, cheers.
I want to rename a report by clicking a command button on a form. I have this simple code in the click event:
Dim strReportNameNew As String Dim strReportNameOld As String strReportNameNew = txtChangeTo.Text strReportNameOld = txtChooseReport.Text DoCmd.Rename strReportNameNew, acReport, strReportNameOld
The code fails with this error message:
Microsoft Visual Basic
Run-time error '29068'
Household Labels cannot complete this operation. You must stop the code and try again.
I am able to rename the report manually.I have searched but been unable to find out what is causing this error.
I made the novice mistake of originally naming a field street #, so I changed it. I went to every place I thought it might affect and still it will not let me access my forms. Is there anyway to find all of the locations it might be and remove it? I am using Access 2010
Is there any way to use a select query where it will select the values off of my database but temporarily use a different column name for one of the columns???
I have 3 different item names stored in my main table. When I compare this to another table, I want to select one of the item names and just pass that as item_name. This way, I can have the same compare routine instead of writing a different compare routine for each item name. Any way? Thanks a lot for the help in advance!
I am copying many many music cds to my hard drive. However, the song file names on the cds are track01.mp3, track02.mp3, etc. I have all the real songnames for each cd listed in the database. I need a way to rename the songs with their real names one cd at a time. My thought was to populate one table with the directory and filenames (track--) of the songs and populate another table with real songnames from the database. Then, somehow, rename the files. I'm lost. I hope someone can help!
I was working on my DB, cleaning up some of the field name that were cumbersome and everything worked fine. Today I was doing some follow up work and I cannot change the field names. All I want to do it change the name of a field from CITY to City, but it won't let me do it. I have tried, change from single click to double click, but I was already using double click to open an object; unchecked Auto-Correct, still nothing.
Yesterday I was able to modify a name from Actions to Action (simply deleting one letter. And State/Province to StateProvince. Worked fine. What bothers me is that I have been able to change a field name before and now I can't. I have tried compact and restore, etc.
I'm using 2013. The first version of my code works great. It opens the correct report and attaches it to an e-mail as a pdf with all of my text etc.
Code:
Private Sub btnEMail_Click() On Error GoTo errHandler Dim strReport As String Dim vMsg As String Dim vSubject As String Dim strWhere As String strReport = "RptJobDSD"
[Code] ....
The problem I have is I would like to rename the pdf, so instead of "RptJobDSD" everytime, it can have some fields [DSDDate] and [JobID] etc.
Before trying the fancy field stuff I thought I'd try just "DSD Test" and see if I could rename it in the first place!
I added this and am getting - Error(32004) - The control name 'RptJobDSD' is misspelled or refers to a control that doesn't exist.
This code is supposed to loop around a directory of photos (named after a project), and then copy a new photos (from another directory) to this folder, numbering them and the logging them in a table tphotos.The first time a copy photos to a new directory the code works fine. And I think I had it working fine before, but now when I copy photos to a pre-existing directory that has already photos, it only overwrites the first photo, instead looking for the last photo and attributing the new photo number n+1.
I've done debug.print in the code, and it looks like is not going into If NewFileName = f1.Name, therefore doesn't compare the newfilename with the files in the folder.
Code: Private Sub cmdAddPhoto_Click() Dim fs, f, f1, fc, s Dim fDial As FileDialog Dim SourcefileName, destDir, FileExt, NewFileName, prjID As String Dim intSel, FileNumber As Integer Dim varSelFile As Variant Dim rsPhoto As Recordset Dim myDB As Database
I am running an autocompact module in Access97 which will created a 'compacted version' of my database. I then want to rename this compacted version to the name of the original database I compacted. I cannot however find a way of doing this in code.
Basically the idea is to compact every 45 minutes or so, but what my autocompact is doing is creating a compacted version under a different name, and so compacting a copy of the database, I then want to change this compacted database name to the original name and re compact every 45 mins
Hello everyone, I hope I’m in the right forum for the question I’m asking.
I’m using MS Access XP with Sql Server 2000 in an Access ADP. I am still designing my Sql Server database and recently I deleted field called “EmpStatus” from my database. When I tried to open the table I got a message that the field “EmpStatus” could not be found. I tried refreshing the table names and reconnecting to the database but neither of those options work and I couldn’t open the table. I finally had to add the field “EmpStatus” back to the table before the table would open.
I experimented with this problem and found that if you change a field name or delete a field in a table either by using enterprise manager or the Access UI, that table will no longer open in an Access project. I even tried creating a new ADP using the same sql server database and that table still l wouldn’t open.
Can anyone explain to me why this is happening, what I doing wrong , or how to get around this problem?
Does anyone have a problem renaming tables, queries, etc in the Navigation Pane? The Pane is set to view by list. If I right-click on an object then click on Rename, the focus just moves to another object. If I use the shortcut menu key on the keyboard then type "m" for rename, the inside of the orange highlighted object turns blue briefly to show you can type in it, then immediately reverts to orange. I don't know if this is a problem with my PC (HP laptop running Vista) or with Access.