I have an application that is using SQL Express as a backend and syncing to a SQL database through SQL web synchronization. This all works great and my clients have my custom application to interface with their local database and do work and it syncs back to the corporate database and I've got it scheduled to run in Windows every minute. What I would like to do is have a button or on event set of code that forces that sync pairing to run and I'm not exactly sure how to do that.
I write Access 2010 apps in VBA that require no knowledge of Microsoft Access on the part of the user. My forms contain all the necessary controls to use the program without relying on any of the Microsoft Access toolbars. I call this "de-Microsofting" the app. When I prepare the .accdb program to create a .accde app, I uncheck every checkbox (Options/Current Database) except "Compact on Close". This works well, but it also hides the Windows taskbar at the bottom of the screen. Some of my users need to be able to jump from my app to others (e.g., Excel) and back without having to exit my app. How can I force the Windows taxkbar to always be on top using VBA or, possibly, some setting?
I have a normal Access table. The first column is ID and is the primary key. The second column is a text. The table consists of two records and is sorted in ascending order. First comes the data set with the ID 1.
Sub test() Set rs_access = CurrentDb.OpenRecordset("tab1") rs_access.MoveFirst MsgBox (rs_access.Fields("id").Value) End Sub
The message box shows 1. So everything is fine. Now I sort the table descending. But I get the same message. Why? Appearently the recordset doesn't know that the table was modified. The recordset should register that the table is modified.
I have an issue with my subform, that when opened inside the main form, I want the form to be opened on its last record (which works) and then I want the subform to be opened on the first record regarding that record ID coming from from the main form. The relationship is many to one, coming from the form to the subform. I have tried several code on many events on the subform so it can goes to the first record, but it sometimes goes to the first, othe times ot goes to the third, i don't know why. I have tried the following:
Private Sub Form_Load() DoCmd.GoToRecord , , acGoTo, 1 En Sub
or DoCmd.GoToRecord , idsPreguntas, acFirst 'idsPreguntas is the control name of the record
I have about 4 combo boxes with a list value of dates in them, combo1 is the 'main control'. When a date from combo1 is chosen and a button is clicked, the other 3 combo boxes receive a default value that closely matches combo1. In fact the default value each of the 3 combo boxes receive exists in that combo box. For example, if I gave combo2 default value "2013/01/01", it actually has that date in its list. What I want to do is trigger a OnChange even after combo2,3,4 receive their values. Other things happen after the OnChage trigger is fired.
I have a database stored out on a shared drive at my company that multiple users connect to via a front end application that they save on their own hard drives. Recently I have noticed that the back end database keeps getting opened exclusively which prevents other users from being able to access the back-end database. For the life of me I cannot figure out what about the front end opens the back end exclusively and cannot find any plausible solutions I thought I could develop something that could force close a back-end database or disconnect all users from it?
I have a button that when clicked moves a piece of data to a subform. I have put the whole sequence below. The trouble I am having is :
- The event will not happen until the form is saved. I think this is because fkTaskID is a new record (auto) number which hasn't generated yet. - If I force the form to save it does work but then I get an error on the INSERT command when not all required fields of the form are complete (see sample in second part below).
Is there a way to save the record and maintain the integrity of the form input - and still have this code work?
BUTTON CODE ========== Private Sub BTNAddReasonRw_Click() Dim dIndex As Long DoCmd.SetWarnings False For dIndex = 0 To Me.LISTReworkReasonsUnselected.ListCount - 1
I have a website that is asp (not .net) based with an Access DB and I am in the process of replacing an old windows 2000 server with a much faster windows 2003 server. Here lies the problem I have a script as part of the admin that exports data to a csv file. The query joins 4 tables together to get the data needed for the export. On the windows 2000 server it takes 1-5 seconds to execute and have the csv file ready for download. On the window 2003 server it times out. I striped it down to use 2 joins and it worked although it took more like 10-20 seconds to export. This exports a specific range of ID's and the range is normally only 40-50 rows. If I put time stamps in the code the problem is in the query of the database, so I know its not in the file write etc.
I am going to rewrite it to use multible querys instead of one large query, but I have many other sites that I am moving to this server that would work better if I can figure out why it is so slow.
The windows 2000 is a 900 mhz server the windows 2003 is a 2.8GHZ server both have 1 GIG of ram. The database file is on the local drive on both servers. I am guessing it is a difference in the Jet version, I just haven't been able to find a solution to the problem. This uses a DSN connection, configured the same on both servers. I have also tried it as a DSN-less connection with the same result.
I have installed access on the server and to execute the command in access it is <2 sec.
I am not an access expert I normally program in .net and php and use MySQL and MsSQL for databases, we just have these legacy sites that use Access DB's
Continuing with production of my database I've come across another wall that I'm trying to pass. My aim is when the user press the "Quit" button it will export everything to a file which is stored on Google Drive as google drive is installed on the laptops that will be using this database.
However the problem is Google drive is stored in the computer user files i.e C:UsersstudentGoogle Drive - is there a way to retrieve the name of the user that is logged into windows?
Code:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _ (ByVal IpBuffer As String, nSize As Long) As Long Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _ (ByVal lpBuffer As String, nSize As Long) As Long Function ThisUserName() As String Dim LngBufLen As Long Dim strUser As String
[code]....
However cant get this to work - I think that is probably because i'm declaring this code in the wrong place - I've tried declaring the private functions in a class module and the functions in a module - however no success - How do you set this code up? Or is there a new way to do this?
I have a vbs-script that opens my access database db.mdb and runs the module "Export":
dim accessApp set accessApp = createObject("Access.Application") accessApp.OpenCurrentDataBase("D:Datadb.mdb") accessApp.Run "Export"
accessApp.Quit set accessApp = nothing
This works fine as a scheduled task on a Windows 7 computer.
Is there a way to make this work on a Windows Server 2008 R2 ? When I double click the vbs-file, the file opens instead of runs. And when I create a scheduled task, nothings happens.
On the Windows 7 Developer desktop, the Windows Theme is set to Windows 7.On the Citrix server (for users) the Windows Theme appears to be Windows 95. It is low graphics.The boxes are square instead of rounded. The selected Form Tabs just barely highlight with a thin line while on Windows 7, the selected Tab completely changes color. A basic Message box in Windows 95 looks square and flat. The title bar is very low graphics as one would expect when graphics were not great. Is there a VBA call that can display the OS Theme that affects MS Access? URL...
I currently have a button on a form which, when clicked, I would like to do several things:
1) Check if the folder, "folder name (1)" exists 2) If no, make it; if yes, check if the folder, "folder name (2)" exists 3) If no, make it; if yes, check if the folder, "folder name (3)" exists 4) repeat this process until a new folder is made
The code I currently have seems to not work, and makes an infinite loop
Code: Private Sub Export_Click() Dim checker As Integer Dim projPath As String checker = 1
I can currently open a new internet explorer instance, navigate to my URL, then use the .getElementByID to insert my preference into a textbox on the page. Looks like this:
Code: Dim oIE As Object Set oIE = CreateObject("InternetExplorer.Application") oIE.Navigate "URL of my Choice" Do While oIE.Busy Or oIE.ReadyState <> READYSTATE_COMPLETE DoEvents
I have always had solid read access to the Windows registry running on Windows XP with Access 2007. I am utilizing code from here in a separate VBA Module to obtain access to the Windows registry:
"Change registry settings in VBA"
[URL]
On Windows 7 x64 / Access 2010 x86, I am seeing a 0 value in lngKeyHandle. Also, m_lngRetVal has a value of 2 after the RegOpenKey LOC.
Code: ' -------------------------------------------------------------- ' Query the key path ' -------------------------------------------------------------- m_lngRetVal = RegOpenKey(lngRootKey, strRegKeyPath, lngKeyHandle) ' -------------------------------------------------------------- ' If no key handle was found then there is no key. Leave here. ' -------------------------------------------------------------- If lngKeyHandle = 0 Then regQuery_A_Key = vbNullString m_lngRetVal = RegCloseKey(lngKeyHandle) ' always close the handle Exit Function End If
I have verified that I have the key successfully in the registry... installed via the .reg file that works on Windows XP / Access 2007 systems.
I wrote VBA code to pull email messages from Outlook in order to create an alert if a message with a specific subject line is not received. I have the system coded to send the alert if the message isn't found before the system encounters a message with a SentOn date/time more than two hours old.
The code has worked great for over a year, but now my company is migrating to Win8 and I'm having issues with the code. The machine that normally runs the process uses XP and Access 2007. The code also works on another machine running Windows 7 and Access 2010.
The issue I'm having in Win8, with Access 2010, is that the code isn't pulling the most recent message first. Instead, it is selecting a message from about two weeks ago, and then cycling through the other messages from that point. I know there are ways I can code around this, but I don't want to if I don't have to.
Is there a setting that I'm missing? I've included the basic code to pull the email messages below:
Code: DoCmd.SetWarnings False Dim ol As Outlook.Application Dim ns As Namespace Dim Inbox As MAPIFolder Dim Item As Object Dim strSubject, strSentDate As String
I need a search function that will not just open files based on their names but also drill into the documents and search based on what's in it. The only way I can see now is to use the Window's search function (the one at the start button). Is it possible to call that function into access?how do I re-create the search style of the windows search bar for a specific folder? Something like streamreader
My customer has Access programs that work on their Windows 98 OS PC's, but when they try to use them on Windows 2000 OS PC's they will not work. The programs I believe were originally written in Access 97 and now they have Access 2000 on the PC's.
By not working I mean the following -
The Access program allows them to enter a document name and then the file opens in Word - BUT - when they use it in Windows 2000 it does not open the document at all. It says file not found in Windows 2000 and the file does exist.
** The reason they have Access opening files is that Access keeps track of them for auditing purposes.
Now here is something that I want to mention. On PC's that were upgraded from Windows 98 to Windows 2000 the programs work.
Can anyone here tell me what is missing from 98 to 2000 that would do this.
At this point, FE db has 4 linked tables, 3 are located in FileBE1, and the 4th is located in FileBE2.
The production BE is located on a server, the test (when working remotely) is on a local computer that is not able to connect to the server. Also, the test BE files (but not the table names) have different names than the production.
I have the idea of creating a table in the Front End that contains a list of users, filename and location (server or local drive).
Upon startup, how could I set up the vba to check the links and if they need to be changed will go and change them without the user having to click on link table manager or be prompted for names and path.
For now, I envision three rows in the table, one for the test user, one for local user and a default UNC for everyone else. (or would it be six rows since there are two files that need link checking and relinking).
I have a Main form that displays a sub-form. On the sub-form is a image box that displays a jpeg associated with the current record. The jpegs are stored outside of the db as links and the links are stored in a table in a field called Image1Lrg_Path. Due to the GUI design the image box is a set size = 4cms X 5cms.
On the sub-form I have a cmd button that when clicked should open a seperate pop-up form that *should* display a large version of what ever jpeg is being displayed on the sub-form. The user would then have to close this pop-up to return to the db in order to continue scrolling through the records as normal.
Main Form = frmPlant_Main Sub-Form = frmPlant_Sub1 Sub-Form Control = Garden_Sub Image Box = Image1
pop-up form = frmLargeImage1 pop-up Image Box = Image1Lrg
Here's my problem:
If I set the pop-up form up a normal form and have a linked control on it (to display the image) and a text box (in which to type in the image path and name) and a cmd button that, when clicked, sets the image box to the value of the text box. Then this all works great, what ever jpeg file name I type in the text box, providing it exists of course, is displayed when I click the command button. Iset it up this way first as a test to see if I could get the image displayed OK.
Just for reference, here is the code I use for the command button;
End Sub ----------------------Code End--------------------------------
Now, if I try to link the pop-up to the image being displayed in the sub-form Access throws up "Can't find the form" errors.Just while I set this up, I am using the cmb button to set the path but in the final db I will want the pop-up form to select what ever jpeg is being displayed on the sub-form as its path.
Can any one suggest how I can get this to work?
Again, for reference, here is the code that I am trying to use when linking the image in the pop-up with that shown on the sub-form;
My question is...is there any way to get Access to work out the actual day of the week from a date entered into the computer? The reason for this is...I am designing and implimenting a bookings data base for a village hall, and I wish access to automatically store what day of the week it will be on the specified date, in a field called 'Day'. I need this field to produce a report for the week ahead, showing exactly what is in on which day of the week. Is there any way this can be done? Or do the days just have to be typed in manually, i.e. check a calendar and type them in? I would appreciate it if anyone could give me info...on ANY way this can be implimented...be it store the dates in a table or use a giant Iif statement or whatever! And the tags necessary would be helpful,
Thank-you for your help in advance, and i apologise for such a lengthy post!
Please get in touch directly through c.majury@ntlworld.com or alternatively post the answer here.
Does anyone have any idea how to sync two forms so that I can create one record in a table from the pair of them.
I have a form which is so big that I have had to place a continuation to a new form on it. However, when I move to the new form, the data is placed into a new record instead of continuing on from where it left off.