ms-access-2010

VBA to prevent empty fields in a user-entry form

折月煮酒 提交于 2019-12-11 02:54:15
问题 I am having trouble with VBA coding which I am using to check for blank fields in a pop-up form. The code is supposed to check for blank fields on the form, notify the user if there are blank forms, and if there isn't, add the record. I have a second function which saves the record, then closes the form. Below is the code I am using to check for blanks: Private Sub Form_BeforeUpdate(Cancel As Integer) Dim ctrl As Control Dim strMsg As String For Each ctrl In Me.Controls If ctrl.Tag = "BlkChk"

run-time error '3197'. MS Access 2010 and SQL Server 2008R2

旧巷老猫 提交于 2019-12-11 02:44:23
问题 I have an application written in MS Access 2007-2010 and a back end is an SQL database. After building a new database, when I view the records from SQL in the Access report, trying to edit or enter new input results with a run-time error 3197. The specific error says: This record has been changed by another user since you started editing it Then I have Copy to Clipboard and Drop Changes options, while the Save Record is grayed out. Clicking on the Drop changes brings the error: "Run-Time

Too few parameters error MS Access SQL

∥☆過路亽.° 提交于 2019-12-11 02:43:32
问题 I'm getting a run-time error: too few parameters: expected 2. This code is supposed to get the next employee in line for assignments. The employees [programs] and [Language] have to match the [program] and [language] in the table CFRRR. strSQL = "SELECT TOP 1 WorkerID FROM attendance WHERE [Programs] LIKE '*" & program & "*' AND [Language] = '" & Language & "' AND [Status] = " & ("Available") & " ORDER BY TS ASC" Set rs = db.OpenRecordset(strSQL, dbOpenDynaset) Here's what Debug.Print strSQL

query that would count and increment the number of duplicate instances of that record

大兔子大兔子 提交于 2019-12-11 02:14:49
问题 Using Access 2010. So if I had a table COL1 A B A C A and the run the query I would get the output in COL2 where 'A' is duplicated three times and its COL2 value is in turn incremented. COL1 | COL2 A | 1 B | 1 A | 2 C | 1 A | 3 回答1: Add a field to your table. Choose AutoNumber as its data type and make it the table's primary key. I named the field ID , so my version of your sample data looks like this ... ID COL1 1 A 2 B 3 A 4 C 5 A The SELECT statement below returns this result set ... ID

Increase the font size of message box in Microsoft Access 2013

梦想与她 提交于 2019-12-11 02:05:25
问题 Is it possible to increase the font size of message box in Access 2013 via vba code? From this to this Some users are over 40 years old. They require a bigger size of font for viewing. Thanks! 回答1: The font size of system error boxes is a system control and would need to be changed on all individual computers. You could instead trap the error in VBA and display your own messages via a UserForm, which would allow you to control the message and the font. So, instead of If countDuplicate > 0

Query returning too few results after adding NOT LIKE condition

余生颓废 提交于 2019-12-11 01:27:35
问题 I have an Access 2010 Database that is behaving oddly when I slightly altered a query that a user requested. I have one very large table (don't ask) that the query runs on and then feeds to a user input form. Anyway, today, one particular form started returning a lot less results than we expected. It normally returns about 1200 results, but after the minor change, that dropped to 880 results. When I was checking it, it should only have dropped to 1100, so I am missing an additional 300

Locking tables in Access 2010

做~自己de王妃 提交于 2019-12-11 01:23:08
问题 How do I lock fields in access so the user is only able to add to table? I want the user to only have access to adding to the table to maintain data integrity. 回答1: Since you are using Access 2010 (or later) you can use event-driven Data Macros to restrict what the users can do. To prevent them from deleting records you can use the following Before Delete macro: If you also want to prevent them from editing existing records you can use the following Before Change macro: For more information

Use text from record to paste into an Access form controlbox

南笙酒味 提交于 2019-12-11 00:19:09
问题 Based on a user's job ID number, I create a recordset of an ID with its different unit types (think pipe sizes) and unit (think footage of pipe). Each unit type record already has the name of the form textbox where the total footage goes in a different column. What I want to do is go through each recordset and plugin the footage for each unit type for that job ID number (that the user puts in a form). Dim rst_UnitEntryCounts As Recordset Set rst_UnitEntryCounts = CurrentDb.OpenRecordset(

Update SQL MS Access 2010

百般思念 提交于 2019-12-10 23:43:36
问题 This is wrecking my brains for 4 hours now, I have a Table named BreakSked, and I this button to update the table with the break end time with this sql: strSQL1 = "UPDATE [BreakSked] SET [BreakSked].[EndTime] = " & _ Me.Text412.Value & " WHERE [BreakSked].AgentName = " & Me.List423.Value _ & " AND [BreakSked].ShiftStatus = '1'" CurrentDB.Execute strSQL1 Text412 holds the current system time and List423 contains the name of the person. I'm always getting this "Run-time error 3075: Syntax Error

How to do the trig function Arc Cos (ACOS() in Excel) in MS-Access?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 22:25:50
问题 I have an excel formula that I need to put into an MS-Access query. Unfortunately, an Arc Cosine function does not seem to be part of Access's repertoire. So in Excel, part of the formula is ACOS(Lots of stuff). So my question is how can I achieve an ACOS() Excelfunction in MS-Access? Note: In case anyone is wondering or in case it actually matters for some odd reason, here is the full equation as it appears in Excel: =(ACOS(SIN(RADIANS(AX2))*SIN(RADIANS(AZ2))+COS(RADIANS(AX2))*COS(RADIANS