ms-access-2010

Update SQL Server table with local data

社会主义新天地 提交于 2019-12-02 13:23:19
问题 I have a project to create an application in Access 2010 that will use a local table to collect data with a tablet (that does not have wireless where data is being collected from) and then when they get back to location that has wireless connectivity to be able to upload the data. I have the SQL Server database and tables. Designed the application using linked tables, then converted them to local tables, so I know the design is the same on both. What is the simplest way to update the sql

Data Conversion error 3421 on OpenRecordset method of DAO QueryDef

▼魔方 西西 提交于 2019-12-02 12:31:04
问题 I want to pass one parameter to a saved query in MS Access 2010 and then also get the results from the query: its my saved query: SELECT Count(*) FROM tb_KonzeptDaten WHERE ( Konzept=[fzg_ID] and (DCMFile is null or (DCMFile=''))); and here is my VBA code to invoke this query: Dim db As DAO.Database Dim qry As DAO.QueryDef Set qry = db.QueryDefs("Test_qr_emptyDCM") qry.Parameters("fzg_ID").Value = ID Set rs = qry.OpenRecordset("Test_qr_emptyDCM") also the Type of ID in VBA code is Long and

How to Create a Custom ID in Access 2010

你离开我真会死。 提交于 2019-12-02 11:51:56
问题 The title of this Question may not be accurate because I wasn't sure how to ask the question. Is there A way to have an ID field in AC 2010 the has a constant part and then a part of the ID that the user will enter in? EXAMPLE: "EMP9066" -I would like the "EMP" part of the ID to be constant at all times and the user should not be able to change it and the "9066" is a four digit that the user will be asked to type in. Please Help. _ Remember this is not SQL just basic access with some macros.

Top 3 per group including 0

天涯浪子 提交于 2019-12-02 11:21:26
I have a table for which I want to return the top 3 records by ErrorMargin per week commencing in Access 2010. The problem I'm having is that 0 values are being ignored and I'd like to see just 1 record in the case of ties where the tie would take the total number of records over 3. The table I have is: NB: VBA at bottom of post to create the table. TMID WeekCommencing ErrorMargin 1 05-Oct-15 0 1 12-Oct-15 2 3 05-Oct-15 1 3 12-Oct-15 1 8 12-Oct-15 2 9 05-Oct-15 0.333333333 9 12-Oct-15 4 12 05-Oct-15 0 12 12-Oct-15 1.5 The SQL I have at the moment is: SELECT T1.TMID, T1.WeekCommencing, T1

How to create a new form instance using the name of the form as a String

南楼画角 提交于 2019-12-02 10:17:41
问题 Code to create new form instance of a closed form using form name I want to replace the long Select Case list with a variable. Full code of module In Access 2010 I have a VBA function that opens a new instance of a form when given a string containing the form's name. By adding a form variable "frm" to a collection: mcolFormInstances.Add Item:=frm, Key:=CStr(frm.Hwnd) The only way I can figure out to open "frm" is with a Select Case statement that I've manually entered. Select Case strFormName

How to show progress on status bar when running code (not queries)

我怕爱的太早我们不能终老 提交于 2019-12-02 10:16:07
问题 I have already posted a question about updating the status bar while running queries in MS Access 2010. Please see How to show progress on status bar when running a sequence of queries in MS Access if you are interested. This is a very simple question about some code that doesn't work. I hope that if someone can answer it, it may help my understanding of why the code for the more complicated question doesn't work. Function PutMessageInStatusBar1() Dim RetVal As Variant Dim i As Long RetVal =

Invalid use of null in where statement; no null values

て烟熏妆下的殇ゞ 提交于 2019-12-02 10:03:27
I have the following problem: I am using two queries to parse imported data, they are both selecting data The imported dataset is pretty complex, but this reproduces the error. QueryA: SELECT CDbl(FieldA) As DblA, Imported.* From Imported WHERE FieldA IS NOT NULL QueryB: SELECT * FROM QueryA WHERE DblA > 7 AND DblA < 600 QueryA runs fine, QueryB throws an invalid use of null error If I insert the results from QueryA into a table and run QueryB against that I do not receive the error, however, this is not desired. If I remove the WHERE from QueryB it runs fine. Is there a different workaround

I get “Syntax error in UPDATE statement” with OleDB

六月ゝ 毕业季﹏ 提交于 2019-12-02 10:02:30
I am developing an information system that works with a connected data source / MS Access database. The question is kinda cliche but I can't seem to find a proper solution from the similar ones I have come across. Here is my code for the button. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'myConnection.ConnectionString = connString 'myConnection.Open() If Me.txtConfirmPasscode.Text = Me.txtNewPasscode.Text Then Dim updateCmd As OleDbCommand = New OleDbCommand("UPDATE Users SET Password = @ConfPasscode WHERE [Usernames] = @UsersID"

Display SQL time field on Access form as Access medium time hh:mm am/pm

爷,独闯天下 提交于 2019-12-02 09:58:27
问题 I am using Access 2010 linked to SQL Server 2008 R2. My problem - how do I display time on an Access form as hh:mm am/pm instead of SQL Server's time(7) format of hh:mm:ss.nnnnnnn ? To complicate things, I do have a look-up table with all the times in half hour time frames? Ex. in SQL, the lookup field says 07:30:00.0000000 - I want to choose a time from the dropdown in my Access form that says 7:30 am and then display it on the Access form as 7:30 am. If I choose it, I want it to store in

Remove redundant Access field cells

纵饮孤独 提交于 2019-12-02 09:12:25
Continued from Combine Access fields into one field given two queries I have the table below with three main fields Name_2010 , Name_2011 and Name_2012 and they need to be integrated as Name_Final . I used the query below to select only a particular member of the three fields per row but currently it does not work as intended as it does not recognize redundant cells. SELECT IIf(Name_2010 In (Name_2011, Name_2012), '', Name_2010) AS N1, IIf(Name_2011 In (Name_2010, Name_2012), '', Name_2011) AS N2, IIf(Name_2012 In (Name_2010, Name_2011), '', Name_2012) AS N3 FROM Table1; What query should I