MS Access 2003中VBA字符串分割的换行 [英] MS Access 2003 VBA String Split on Line Break

查看:640
本文介绍了MS Access 2003中VBA字符串分割的换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MS Access窗体的用户会一列数字从Excel US preadsheet复制到一个文本框。我需要这个输入,并将其作为参数来构建查询。我有code,看起来像这样

I have a textbox on a MS Access form that users are going to copy a column of numbers into from an excel spreadsheet. I need to take this input and use it as parameters to build a query. I have code that looks like this

Dim data as variant
Dim input as String
data = Split(input,vbLf)

我希望能够建立从用户输入的清单,但我想不出如何在换行符分割它。我已经试过\ñ\ r,即\ N。 \ r,vbCrLf,vbLf。输入类似12345 [] [] 23456每个数字之间的框字符

I want to be able to build a list of the input from the users but I can't figure out how to split it on the line break. I've tried "\n\r", "\n". "\r", vbCrLf, vbLf. The input looks like "12345[][]23456" with the box characters between each number

感谢

推荐答案

我得到了拆分工作使用vbCrLf我。我也写了拆分的结果到字符串数组中。

I got Split to work for me using vbCrLf. I also wrote the result of Split to a String array.

下面是我的code:

Dim data() As String
Dim yourInput As String
data = Split(yourInput, vbCrLf)

这篇关于MS Access 2003中VBA字符串分割的换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆