ms-access

Access Query Memo field truncation due to "distinct"

I am having problems running a query without either truncating the note field in NotesTbl or returning repeated entries. UID is not unique for AccessTbl. When I leave out "distinct" notes will return multiple times because I am joining with AccessTbl on a non-distinct condition. When I use distict, the note field is trunctated because...

What would be the best way to write this query

I have a table in my database that has 1.1MM records. I have another table in my database that has about 2000 records under the field name, "NAME". What I want to do is do a search from Table 1 using the smaller table and pull the records where they match the smaller tables record. For example Table 1 has First Name, Last Name. Table 2 h...

Populate list box from a table in vba

I am developing a vba form for employee database, in that there is a search criteria for userid and employees name with the userid should be displayed in a list box control which comes from a single table I need to populate a list box with value from a table according to a value in a text box which act as a search box (eg: userid) Plea...

How can i call the below function to populate my access form list control

I need to populate the access form list box from a access table. Below is the code which I copy-pasted on button click event: Public Sub PopulateLBWithData(DBPath As String, _ TableName As String, FieldName As String, _ oListControl As Object,Optional Distinct As Boolean = False, _ Optional OrderBy As String) ''#PURPOSE: Populate a l...

VBA sql query problem

Below query is resulting NO rows lstResults.RowSource = "select EmpId from tblTesting where Empid ='" & Me.txtSearchEmpId.Value & "'" Where below working fine : lstResults.RowSource = "select * from tblTesting" WHere is the fault here? I check the value of '" & Me.txtSearchEmpId.Value & "'" using break point its having the value o...

Reg Access Query

Look at the example below type qty total A 10 10 A 5 15 S 7 8 A 12 20 S 5 15 I want an access query which can find total ie if type is 'A' add it to total and if type is 'S' subtract from total.Can anyone help me. ...

VBa insert shortcut

I am planning to insert value in a vba access form text box values to the table in same access file Here i will write a insert query on the submit button click event Is there any shortcut methods to add the value into the table? Like seting the datasource for the textbox and inserting values of all textbox in the form using a click o...

Proper Use of a Class Instance

I'm using Access 2003 VBA to process recursive data for manufacturing BOMs. I built a class module to let my main tables have static scope. This seems to simplify recursion -- it sets me free from counting levels down and up again as I traverse a BOM. I'm not opening the same recordset redundantly; I'm filtering a lot instead. Afte...

Passing variables from child to master form

I have made an Access 2007 db. I will be writing some basic vba for the appropriate event of a form so that a modal form is displayed when the original form is opened. This isn't difficult, but that form will have a drop down box of IDs from a particular table. The user will select an ID, but I want the selected ID from this form to go b...

Changing VC++6 app database from Access to SQL Server - can I use linked tables?

We have a Visual C++ 6 app that stores data in an Access database using DAO. The database classes have been made using the ClassWizard, basing them on CDaoRecordset. We need to move from Access to SQL Server because some clients have huge (1.5Gb+) databases that are really slow to run reports on (using Crystal Reports and a different ap...

Query to find the running sum of a column(qty) based on type(if 'a' add else subtract)

I have table with data as follows: Store ItemNo Type Billno Qty London 1 A 1 10 London 1 A 2 5 London 1 S 1 7 London 1 A 3 5 London 1 S 2 7 London 2 A 1 19 London 2 ...

Code or the control properties, which is better in MS-ACCESS?

I found sometimes is really difficult to choose which one to use, e.g I want to fill up the data to a list box, you can do it by select data and build a query for it, also you can build a VBA code and put it under the control event. So, which one is better or we say, if we have choice which one is the best? Thanks ...

Dlookup problem null value

I have a problem with the below dlookup fuction its result Null value txtAbsSunStore1.Value = DLookup("Store1", "tblAbsense", "TestId = " & lstResults.Column(1, 0) & " And Day = 'Sunday' And Empid = " & Me.txtEmpIdSearch.Value & " ") All the variable have value and the corresponding value is there in the table too ...

Delete data from multiple table

I have the below query which will delete data from multiple tables its not working please help me : DoCmd.RunSQL ("delete tblTesting,tblCodes,tblContract,tblScheduled,tblAbsense,tblClock from tblTesting,tblCodes,tblContract,tblScheduled,tblAbsense,tblClock where tblTesting.TestId = " & lstResults.Column(1) & " And tblTesting.Empid = ...

Passing array byref doesn't edit original array

I'm trying to write a subroutine in access 2003 that removes all quote characters from strings in an array. The subroutine removes the quotes successfully in the routine itself, but not when the program returns to the passing function. I'm very confused, as it is done ByRef. How it is called: Call removeQuotes(wbs_numbers()) and the ...

MS Access Reports

I have a database of meetings. I can generate a report that sorts the actions by meeting but I would like to generate a separate report for each meeting. Any thoughts? ...

Entity Framework with OleDB connection - am I just plain nuts?

I'm experimenting with the Entity Framework and I want to connect to an Access 2007 database. The following code is inspired by http://msdn.microsoft.com/en-us/library/system.data.entityclient.entityconnection.connectionstring.aspx I suspect that I've got the wrong end of the stick... OleDbConnectionStringBuilder oledbConn = new OleD...

Odd Results from an SQL query in MS Access

Alright, here's an odd one from an MS Access database I'm running. I have a SQL query: SELECT * FROM [Service Schedule] WHERE ID=2 AND Volume <= 3000 AND Term='Monthly' AND special = 'Regular' ORDER BY volume When I put that into the SQL view of the query builder, I get 2 records, one with a volume of 0 and one with a volum...

What is the MS Access SQL syntax to create a field of type Hyperlink?

I'm working on a C# project that uses System.Data.OleDb.OleDbCommand class to create and alter tables in an MS Access DB. I generate the SQL statement, pass it to the object, then call the ExecuteNonQuery function. I was able to figure out the proper MS Access SQL syntax to create columns of the following Access data types: AutoNumbe...

MS Access 2000 - VBA Value from a combo/text box into a file path string

Hey guys. I have a form that I intend to allow users to browse powerpoint presentations through, because there are a lot of different briefs for metrics, which is what I use this database for. So, I already know how to set up everything, just got one little hang up. If I place a combo box on the form to select from a list of different p...