Modules & VBA :: How To Use Split Function Query

Feb 18, 2014

I have a query

Code:
SELECT tblZlecenia.ID_Zlecenia, tblZlecenia.TerminOdbioru, tblOffset.ID_RodzajZlecenia, tblZlecenia.NazwaZlecenia, tblZlecenia.Id_K, tblZlecenia.Id_Rodzaj_Pracy
FROM tblZlecenia LEFT JOIN tblOffset ON tblZlecenia.ID_Zlecenia = tblOffset.ID_Zlecenia
where

In where I would like to put code like this:

Code:
Split(tblOffset.DziedziczonePo, ";")(1) & ";" & Split(tblOffset.DziedziczonePo, ";"(2) & ";" = "tak;tak"

Is it possible to create such a query?

View Replies


ADVERTISEMENT

Modules & VBA :: Creating A Function That Counts Records And Use That Function In A Query

Dec 11, 2013

So basically I need making a function that will count the number of records from another table/query based on a field from the current query.

View 2 Replies View Related

Use Split Function In SQL

Nov 25, 2004

hi guys/gals!
can i use the split function in queries?

example:
xxxxxxx / xxxxxxx

i only need the first "x's" in my report.


thanks in advance!

View 1 Replies View Related

Need Help Using The Split Function In Mdb

Jul 13, 2005

First, my knowledge is limited so please forgive me. The problem I have is a persons full name in a column and I wish to have first name in a column and last name in a column.
ex: John Public
I would like it to be
John
Public

thanks in advance!

J

View 1 Replies View Related

Split Function On A Recordset

Feb 2, 2006

Hi

i open a query as a recordset in VBA. i then need to use the split function to split up a few fields. how do i do this for the entire recordset.

for example:
MySplitVar = split(rst1("Field1"))
now i need
rst("Field2") = MySplitVar(0)
rst("Field3") = MySplitVar(1)

keep in mind i can't write to table. i need to somehow create a new recordset (maybe clone) and add columns to it. also, i don't know if this is relevant, but i will need to do this for up to 12 columns which means that i will have two per column; i.e. total columns=24

I see that nobody is posting an answer so i will add an explanation what i am doing.

i came up with a great idea. i need a crosstab that shows two values. so i created a a column that has both my columns in one column. value column shows the following:
myValue: = myFirstValue & " " & mySecondValue
and in the total i select First. so now i have a crosstab that shows two numbers with a space between them. now i have a report that will show this crosstab query. then i set each field's controlsource on the report to a particular field on the crosstab. my problem is that i first need to split it up and i am stuck there. i need to somehow add columns to the recordset.


thanks,

sam

View 8 Replies View Related

Queries :: How To Use String Split Function

May 26, 2013

How many kind of string inbuilt function we have or if we create our on function so how to call that function in your query...

View 6 Replies View Related

Modules & VBA :: How To Write A Function That Does Query

Jul 22, 2013

I have a query string in the following code. I want to put the entire code into a function so I can use it somewhere else as well.

Code:

Private Sub Form_Load()
'To enable the AllowAddition property once the form is opened
Dim dbs As DAO.Database

[Code]......

View 5 Replies View Related

Modules & VBA :: How To Run A Function From SQL Query In Access

Nov 26, 2013

I started using Access recently and I have an inquiry about VBA codes and sql queries. I have function which has the following signature: RAG(Stability as Integer, DS_SYNC_RATE as Integer, Profile as String) as String.

I would like to call this function in Insert sql query in order to calculate and add a new column to my table. I tried this basic query:

Insert INTO my_table VALUES (RAG(my_table.stability,my_table.ds_sync_rate, my_table.profile))

but it doesn't seem to work...

View 8 Replies View Related

Modules & VBA :: Undefined Function For A Module Called In A Query?

Sep 8, 2013

This module is giving me the "undefined function" error message when I try to run my query. I don't know why, but I have checked that there are no references with "missing" and there are not. I also added the word "Public" to the function becasue that was advised by another forum user. I thought it worked perfectly the first time I ran this query, but now it is not working and I do not recall making any changes. I have called the module basFunctions:

Option Compare Database
'************************************************* *********
'Declarations section of the module
'************************************************* *********
Option Explicit
'================================================= =========
' The DateAddW() function provides a workday substitute
' for DateAdd("w", number, date). This function performs
' error checking and ignores fractional Interval values.
'================================================= =========
Public Function DateAddW(ByVal TheDate, ByVal Interval)
Dim Weeks As Long, OddDays As Long, Temp As String

[code].....

View 3 Replies View Related

Modules & VBA :: How Can Function Return Multiple Values And Not Re-run In Query

Jan 11, 2014

Trying to run a query where each 4 fields calling a custom function will not just re-run the same custom function over and over again for each field in a single record.

A Function has a huge amount of multiple queries and logic to perform.The Function returns a Integer, Integer, Integer, and optional Integer. Each integer requires a DLookup to lookup a String description value for each individual integer (in each of 4 fields).

The problem is, the DLookup in each column that runs against each of the integers re-run the same function.The result is that a single record, each of the 4 columns returning a single of the 4 values, the complex function is re-run 4 times.

The function is huge, part of a Business Rules Engine. Depending on the Rule-Meta data - it might launch up to a dozen queries and perform logic steps for each record. This is not the ordinary SQL Query.

Imagine if one record (for 1 field) takes 0.1 second to run. By referencing the function in 4 columns, this same function is re-run 4 times (0.4 Seconds) Against 50,000 records - this duplication of re-running the function for each column can really add up.

Possible Solutions: Researched Class Modules - There is a comment that the property Get, Let actually reduce performance. There are huge advantage of code documentation, documentation and centralization.It doesn't claim class modules reduce execution as each propery is returned. It also describes that Class Modules can't be called directly in a Query - unless each property is wrapped in a function.

Function Returns one String with delimiters: e.g 34;54;55;1 This single column goes into a Make Table (runs function one time per record) Then the D-Lookup is run against static local data. This pevented the function from being run over and over across the network linked data.

Final Solution: Eventually, the many hundred lines of VBA code for the Rules Engine will be converted into SQL Server T-SQL Functions on the server.For a Rule Engine development, Access has been great for a rapid protoype development and testing. The TSQL will be a final big step requiring re-coding. It is not currenty my option for the delivery time frame.

View 8 Replies View Related

Modules & VBA :: Using Public Function To Feed A Variable String To Query

Feb 26, 2014

I am using a public function to feed a variable string to a query. So far I have got:

Code:
Public Function ClientStreetModule(firstLVar As Variant, streetVar As Variant, newFL As Variant) As String
Dim cslStr1 As String, newStreet As String
newStreet = Right(streetVar, Len(streetVar) - Len(newFL))

[code]....

However, I only need to use newStreet as the true part of iif, in which instance all are longer. At least I think this is the problem. I realise I might need to use NZ but am not sure how. Why it is evaluating and giving errors for all records and not just when the iif criteria is true as I want it to?

View 7 Replies View Related

Modules & VBA :: Pulling Data Using Query - Combine Two Functions Into Third Function

Jun 28, 2013

I created two functions to use when I'm pulling data using a query (QBE). I would like to combine the two into a 3rd Function that works like this:

BB_Only = DishNetActivityCode = 1 and VideoActivityCode = 0
Hybrid = DishNetActivityCode = 1 and VideoActivityCode = 1
V_Only = DishNetActivityCode = 0 and VideoActivityCode = 0

Function DishNetActivityCode(service_code_string As String) As Integer
Dim CodeArray, i As Integer

[Code] .....

View 14 Replies View Related

Modules & VBA :: Can Split A Backend Into Two

Jul 1, 2013

I've got a Split Database (Front End & Back End). So far it was all good until recent when a department placed in a different city (200 Miles apart) wants to use my application. The Application has gone very slow for them when they access the back end.

Things which I've already done.
Analyzed Tables
Analyzed Performance

The only best way I could think of is to have two separate Back Ends for both cities and synchronize them may be every hour or so. Is this possible and how much feasible is this? Or is there an even better way to accomplish this.

View 3 Replies View Related

Modules & VBA :: Split Database - UNC Path

Jun 10, 2015

I am using Access 2010 in a split database. The intent is to place the back end and associated linked files on a server and the front end on work stations for each user. The typical user will just be searching for information in the database not altering it. My current code re-links the tables once the path is known i.e. I have to hard code it into the global constant. Is there a way in VBA or utilizing VBA to read/write to an ini file (for example) that the UNC path would automatically be updated to a global constant in my current code that can be updated automatically based on where the back end is installed.

Global Const BE_DATABASE = "192.168.2.3FMCENFMCTABLES.accdb"
Global Const BE_PASSWORD = "***********"
Global Const BE_DATABASEPATH = "192.168.2.3FMC" 'used to open files
Public Sub CreateDatabaseLinks()
On Error Resume Next 'new
Dim ws As DAO.Workspace
Dim db As DAO.Database
Dim td As DAO.TableDef

[code]...

View 5 Replies View Related

Modules & VBA :: Split CSV Into Multiple Tables

Jan 15, 2014

I have a CSV file that the system is producing; it is one file with multiple sections in it eg...

Quote:

[Names]
001,"John Doe"
002,"Jane Doe"
003,"An Other"
[Address]
001,"63 Huntly Street","CRANMORE","BA4 7HA"
002,"52 Southern Way","NORTH QUEENSFERRY","KY11 3YZ"
003,"20 Scrimshire Lane","ASKETT","HP27 2AS"
[Orders]
001,"0001A","Screwdiver",1,8.99
001,"0001A","hammer",1,15
001,"0001A","no 3 screws",1,5
001,"0001A","drill",1,49.99
etc etc etc

The file is huge with many sections (eg Names, Address) in it. What I need to do is load it into Access for some analysis.Is there a way I can split the file one loading to the system into multiple tables?

View 14 Replies View Related

Modules & VBA :: Split Delimited Field To New Record?

Sep 19, 2013

I need writing a function to split the image names. In essence, I need to create a separate record in a related image table. I have searched over and over again I can't seem to produce the results I need.

I would like to review the records in query so that I can add criteria before appending them.

BV-GB bv-gb.jpg
CSO-C sso-c, cso-c, eso-c.JPG

The number of images for each product varies as well.

View 10 Replies View Related

Modules & VBA :: Users Connected To Split Database

Sep 30, 2013

I have an project with a split database. The data is stored in the database_be.accdb

I want to know which users are connected tot this database.

View 4 Replies View Related

Modules & VBA :: Split Database - Reading Records

Jul 2, 2013

My database was working fine until I split the database and now I'm having issues with this function:

Code:
Public Function OpenFirstAttachmentAsTempFile(ByRef rstCurrent As DAO.Recordset, ByVal strFieldName As String) As String
Dim rstChild As DAO.Recordset2
Dim fldAttach As DAO.Field2
Dim strFilePath As String
Dim strTempDir As String

[Code] ....

It's getting stuck on the "strFilePath = strTempDir & rstChild.Fields("FileName").Value" line. The debugger says that there is no reord. The strTempDir is correct. I am assuming that the issue has to with linking to the database.

View 6 Replies View Related

Modules & VBA :: Determining Number Of Users Of Split Database

Nov 1, 2013

We have a database that is split. Every user has their own front end (installed via a .bat file so that the users always have a local copy of the most recent version), linked to a shared back end on a server. This seems stable and functional for us so far.

However, because our users are geographically separated, I don't actually know how many folks are using the database. I know the folks who contact me, but everyone in our company could use it if they wanted to.

For requesting funding, guiding future development, etc., I need to get some metrics:

Total number of unique users
Avg uses per day

Total number of simultaneous users (daily, weekly, and monthly maxes and mins)

What is the best way to get this info? Write user info and a timestamp to a table each time a front end is launched? Are there tools for monitoring this sort of information?

View 3 Replies View Related

Modules & VBA :: Split Database - Customize Links And ACCDE

Jul 25, 2013

I have a split Database into Back-End and Front-End. I want to hide the Access Customize Option in my Front-End. I have tried to make the Database ACCDE but the option still appears to Customize the Access Database.

I also want to know why is it that when i make a Database ACCDE - some of the codes are not working properly???

View 9 Replies View Related

Modules & VBA :: Trying To Split A Dashed Number Into Multiple Columns

Jul 22, 2013

I am trying to split a number sequence (Ex. 25372-400-E10-0000-D0021) Where the third number in the sequence can be either 2 or 3 numbers/letters.

The idea is to have a query that will split this number into its individual parts. I have seen several forums about splitting two numbers and such but I can't seem to make that work when I need to create 5 columns from this one field.

View 7 Replies View Related

Modules & VBA :: Remove Specific Filter From Split Form?

Jun 27, 2013

So I have been developing a database tool that needs to have multiple ways of filtering data. I wanted to be able to display the data nicely so I'm using a split form.

As usual, there is an easy to read form on the top half and a datasheet on the bottom half. On one side of the form half I have some comboboxes that are associated with fields in the datasheet. The comboboxes apply multiple filters, narrowing the search results down. It all works fine.

However, I've been trying to figure out a way to remove just one filter at a time. There is a button to the right of each combobox that is intended to clear just one filter.

So far this is what I have. This code clears all filters.

Code:
Function removeFilter(source As String, combo As ComboBox)

'source is the field being filtered and combo is the current
'value of the combobox

With Forms("PART_QUERY")
.Filter = "[" & source & "] = " & Chr(34) & combo & Chr(34)
.FilterOn = False
End With

End Function

I had some success using another method with select statements. Every time I cleared a filter, I would also check every other combobox to see if they were not null, then reapply each one of there filters. That seems way over complicated. I'm sure I'm missing something.

How do I remove one, specific filter from a split form, after I have applied many different filters?

View 4 Replies View Related

Modules & VBA :: Split Data Within A Record Into Multiple Fields?

Sep 3, 2013

I have an access table that looks like the below:

"field1", "field2, field3, field4, field5, field6, field7"
"field1~field2~field3~field4~field5~field6~fie ld7"
"field1~field2~field3~field4~field5~field6~fie ld7"
"field1~field2~field3~field4~field5~field6~fie ld7"
"field1", "field2, field3, field4, field5, field6, field7"
"field1~field2~field3~field4~field5~field6~fie ld7"

I've got a module which loads the data into a table, but it can't handle the records that are ~ delimited, so spits them out as a single field.

I know there is some VBA code that can be used to split comma delimited records, and I've seen bits of it floating around online and tried to alter it to work for the ~, but I get the feeling that what I've seen is only a part of the required code, how to put it all together to make something that actually works.

So, what I need to do is;
- Split some records in a table out into multiple fields where there is a ~ present
- Place these newly split fields into a table (I don't mind if it ends up in a new table or not)

View 7 Replies View Related

Modules & VBA :: Find Out Which Records Actually Being Used / Open / Edited In Split DB

Jan 21, 2015

I have a split db in use by about 20 people. Ocasionally a user opens a record that is already opened by some other user and if changes are made then he gets error 7878; "the data has changed error"

Is it possible to find out which records are actually being used/open/edited in a split db? All tables are related to the main key (CallID on table Contacts).

If it was possible to find out, I could have a label show up in the db record search form telling the user not to open that record.

View 6 Replies View Related

Modules & VBA :: Securing Access 2010 Split Database?

Dec 9, 2013

I have a split db with tables in the back end and my forms, reports, code etc. in the front end.

I encrypted the back end with a password. That worked fine.

I deleted and relinked my tables to the encrypted back end. That worked fine as well.

I have a function that will disable the shift key bypass. If I run that in my front end db then I can't save it as an accde because I can't get to the HOME screen. If I save it as an accde first then I can't run my 'disable shift key bypass' function because I can't get to the modules!

How can I secure a split Access 2010 database so that the user cannot execute shift bypass on the front end or make any changes to the code?

View 7 Replies View Related

Modules & VBA :: Split Database - Moving Table To Existing Backend

Apr 8, 2015

I have a client that is using a split database. I am working on an update to the program and need to transfer a table to the backend that has the correct structure and information included in it. My thoughts are to make a one time use program that transfers the table to the backend. I have seen DoCmd.TransferDatabase and DoCmd.CopyObject as possible ways to go.

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved