ms-access-2010

Access 2010: Syntax error (missing operator) in query expression

烈酒焚心 提交于 2019-12-28 02:12:09
问题 I want to have three tables in my sql query but I get an error message. I have this sql code: SELECT warehouse.expiry_date, pharmacy.expiry_date, drugs.active_substance, drugs.strength, drugs.strength_type, drugs.dosage_form, drugs.minimum_quantity, SUM(warehouse.in_quant)+SUM(pharmacy.in_quant)-SUM(warehouse.out_quant)- SUM(pharmacy.out_quant) AS Total_available_stock FROM drugs as a INNER JOIN warehouse as b ON a.ID = b.drug_id INNER JOIN pharmacy as c ON b.drug_id = c.drug_id GROUP BY

FileDialog doesn't work

拟墨画扇 提交于 2019-12-27 15:48:12
问题 I've looked quite intensely, but couldn't find a post that directly solves my problem. The following code for a form I created works in Access 2003, which I use at work. Dim FileName As FileDialog Set FileName = Application.FileDialog(msoFileDialogFilePicker) Dim Name As Variant With FileName .AllowMultiSelect = False .Show If .SelectedItems.Count = 0 Then MsgBox "No file selected." Exit Sub End If End With For Each Name In FileName.SelectedItems FileNameTextBox.Text = Mid$(Name, InStrRev

FileDialog doesn't work

こ雲淡風輕ζ 提交于 2019-12-27 15:44:27
问题 I've looked quite intensely, but couldn't find a post that directly solves my problem. The following code for a form I created works in Access 2003, which I use at work. Dim FileName As FileDialog Set FileName = Application.FileDialog(msoFileDialogFilePicker) Dim Name As Variant With FileName .AllowMultiSelect = False .Show If .SelectedItems.Count = 0 Then MsgBox "No file selected." Exit Sub End If End With For Each Name In FileName.SelectedItems FileNameTextBox.Text = Mid$(Name, InStrRev

FileDialog doesn't work

﹥>﹥吖頭↗ 提交于 2019-12-27 15:43:02
问题 I've looked quite intensely, but couldn't find a post that directly solves my problem. The following code for a form I created works in Access 2003, which I use at work. Dim FileName As FileDialog Set FileName = Application.FileDialog(msoFileDialogFilePicker) Dim Name As Variant With FileName .AllowMultiSelect = False .Show If .SelectedItems.Count = 0 Then MsgBox "No file selected." Exit Sub End If End With For Each Name In FileName.SelectedItems FileNameTextBox.Text = Mid$(Name, InStrRev

Hide Controls in MS Access Based on Value Field

随声附和 提交于 2019-12-25 19:36:56
问题 I am trying to hide some controls in a form in MS Access. The idea is that a linked table has a type of question such as OpenResponse or OptionBox. Given this input I want to switch the type of input the user can input. Here is a sample of what I have: Private Sub QuestionType_AfterUpdate() Dim QType As String Set QType = Me.QuestionType.Value Select Case QType Case OpenResponse Forms("Survey").Controls(AnswerField).Visible = True Forms("Survey").Controls(OptionTitle).Visible = False Forms(

Hide Controls in MS Access Based on Value Field

依然范特西╮ 提交于 2019-12-25 19:36:06
问题 I am trying to hide some controls in a form in MS Access. The idea is that a linked table has a type of question such as OpenResponse or OptionBox. Given this input I want to switch the type of input the user can input. Here is a sample of what I have: Private Sub QuestionType_AfterUpdate() Dim QType As String Set QType = Me.QuestionType.Value Select Case QType Case OpenResponse Forms("Survey").Controls(AnswerField).Visible = True Forms("Survey").Controls(OptionTitle).Visible = False Forms(

Filter a Report based on user input Microsoft Access

痞子三分冷 提交于 2019-12-25 16:49:54
问题 My apologies if this is an easy/straightforward solution, but I am new to Access, and I have been having some problems with my reports. I have created a report template which I want to open a single page report based on a specific IDENT NO. All of the fields in the report are then generated from the associated IDENT NO. As it currently stands, when I open the report, it will create a single page report for each ID number in the Report Data table when opened. Instead, when the user is

Access - Export subform filtered results with custom file name

馋奶兔 提交于 2019-12-25 09:11:38
问题 I'm exporting filtered results from my subform to Excel, and naming Excel file as I want. Here's my code : Sub XcelExport() Dim Results As Recordset Dim RecCount As Integer Dim XcelFileName As String Dim FilePath As String Dim wb As Excel.Workbook Dim XcelFile As Excel.Application 'Set name of file with date XcelFileName = "MySubform_Results_" & Format(Date, "dd/mm/yyyy") & ".xlsx" ' Set destinaton folder of saved file FilePath = CurrentProject.Path & "\" & XcelFileName Set XcelFile = New

can't build a link between unbound forms

被刻印的时光 ゝ 提交于 2019-12-25 07:29:38
问题 I have two tables in my database, Person and Action . Person has a one-to-many relationship with Action . I'm trying to build a Main form that has a Person form and an Action form on it, so that when an entry for Person is clicked on, the corresponding entries in Action show up in the Action subform. But when I view Main in Design mode, and click 'Link Master Fields' in the properties for the Action subform, I get this error message: Can't build a link between unbound forms. How can I set up

How can I check if an instance of a Access 2010 form is still open?

隐身守侯 提交于 2019-12-25 06:52:57
问题 Preface I have a need to create multiple copies of a search form (in Access 2010 ) that returns a value to the calling (which is also the form that created the instance of the form). As mentioned these forms could and will have multiple copies running at the same time for example a user could want to add a company to something so they: Click "select company" and open an instance of the company search screen Then open the company editor (leaving the original company search/selection screen