Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 22090 articles
Browse latest View live

VB6 is DEAD!


Is there a control to replace Acro PDF viewer?

$
0
0
As now AcroPDF.DLL no longer works with VB6, is there a way to use something else that would serve that function? All I need is a PDF viewer, opener, browser, what do I know.

Some advice please.

[RESOLVED] Error making User Control

$
0
0
Here is my UC code

Code:

Option Explicit

Public Event Click()
Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

Private Sub UserControl_Initialize()
 UserControl.BackColor = vbWhite
 UserControl.BackStyle = 0
End Sub

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
 Set Picture = PropBag.ReadProperty("Picture", Nothing)
End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
 PropBag.WriteProperty "Picture", Picture, Nothing
End Sub

Public Sub requestRefresh()
 UserControl.Picture = UserControl.Image
 UserControl.Refresh
End Sub

Public Property Let ScaleWidth(newSW As Single)
 On Error Resume Next
   
 Redraw
End Property

Public Property Get ScaleWidth() As Single
 ScaleWidth = UserControl.ScaleWidth
End Property

Public Property Let ScaleHeight(newSH As Single)
 On Error Resume Next
   
 Redraw
End Property

Public Property Get ScaleHeight() As Single
 ScaleHeight = UserControl.ScaleHeight
End Property
'====================================================
' Picture and Image control
'====================================================
Public Property Let Picture(newPic As StdPicture)
' this calls the Set Picture() method below, no code needed here.
End Property

Public Property Set Picture(ByVal newPic As StdPicture)
 On Error Resume Next
 Set UserControl.Picture = newPic
   
 Redraw
   
 PropertyChanged "Picture"
End Property

Public Property Get Picture() As StdPicture
 Set Picture = UserControl.Picture
End Property

Private Sub UserControl_Paint()
 Redraw
End Sub

Public Sub Redraw()
 UserControl.MaskColor = UserControl.BackColor
 Set UserControl.MaskPicture = UserControl.Image
 UserControl.Refresh
End Sub

Public Property Let Cls(Clear As Boolean)
 UserControl.Cls
End Property

Public Property Get AutoRedraw() As Boolean
 AutoRedraw = UserControl.AutoRedraw
End Property

Public Property Let AutoRedraw(ByVal New_AutoRedraw As Boolean)
 UserControl.AutoRedraw() = New_AutoRedraw
 PropertyChanged "AutoRedraw"
End Property

Public Property Get BackColor() As Long
  BackColor = UserControl.BackColor
End Property

Public Property Let BackColor(ByVal NewValue As Long)
  UserControl.BackColor = NewValue
End Property

Private Sub UserControl_Click()
 RaiseEvent Click
End Sub

Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
 RaiseEvent MouseDown(Button, Shift, X, Y)
End Sub

Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
 RaiseEvent MouseUp(Button, Shift, X, Y)
End Sub

When I try to run project I get User-defined type not defined on any of the highlighted red Property events.

I copied this code from another UC I am using and all I did was change the UC name and added it to another project.

Need Help with COMDLG32.ocx

$
0
0
My app, a commercial engineering training program built with VB6, uses SetUpFactory from Indigo Rose to build the installation program. I want the setup program to launch my app automatically on closing, as well as place an icon on user's desktop. My app starts fine when launched from the desktop icon, but when launched by the installation program, an error message is generated: "Runtime Error 339. comdlg32.ocx is not registered properly; a file is missing or corrupt."

Why would launching the same app in two different manners cause different launch characteristics, one good and one bad.

Need help soon. Must ship by Thursday.

hal w

help about dll or ocx

$
0
0
I have not been into programming dll or ocx yet so I dont have good background on it.

My issue is, I have this two programs which similarly will encode the same set of data and show same set of data in msflexgrid. So I am thinking how to create a dll or ocx for the encoding those data and presenting it on msflexgrid so I can reuse it over and over.

I am thinking for an example on how to do that and from that, after studying it, if I have further questions, I can ask further questions from it..

Thanks

datagrid connecting records in excel in vb6.0

$
0
0
good day to all. i need help at this time. how can i connect datagrid records to excel and how can i open that excel file using a button?
answer me please!
thanks!

tbl vaSpread in VB3 - How do I right align the fields?

$
0
0
I have a form in VB3 which has a tbl vaSpread defined in it. It looks like a big table. To populate each row of the table, the code I have constructs a big string where the individual fields are tab delimited (it uses Chr$(9) to insert the tabs). After this, the code Redraws the table (Form.tbl.ReDraw).

I have some numeric fields I want to display in this table, and I want them to be right aligned. Does anyone know how to do this?

I tried everything that was suggested here http://support.microsoft.com/kb/217012 and it doesn't work correctly. The fields are not right aligned correctly - some are more to the left than others, depending on how large the numeric field is.

The code does set some attributes for the fields eg. Form.tbl.ColWidth(5) = 14 , Form.tbl.Col = 5, Form.tbl.UserResizeCol = SS_USER_RESIZE_OFF, Form.tbl.Value = "Amount". But I can't find the attribute for Alignment anywhere. Nor can I find the attribute to define them as Numeric.

Can someone assist please?

Changing the icon of exe file of VB6.0 project that uses a resource file

$
0
0
I need to change .exe icon of the project. The icon is of 32-bit. The icons are coming from a resource file. I tried adding the icon to the resource file, but VB 6 doesn't allow to add icons of more than 256 colours.

Even if I modify the resource file using application like ResEdit and add the icon, the resource file does not load the new icon in VB6 resource editor. Can anyone please help me on this?

Hiding a form closes the application

$
0
0
Hi,

My dll contains a form with a command button that should hide it

The dll is called by an MyApp.exe file. When the user hides the form, the application closes completely and some timers events are no longer fired . MyApp.exe does no longer appear in Windows Task manager

Please help clarifying

Avi

About using RegDllView to mass re-register OCXs on the Authoring Computer...

$
0
0
Hello I am looking to have a Freeware Application to mass-register 1483 (YES!!) ActiveX Controls on my system, before I look to authoring in Windows 8.1. Also that I have Visual Studio 6.00 working under Windows 8.1. However it didn't like the MSDN CD (3rd of Enterprise Edition) so much that it just doesn't let it run, at all...

Can someone please help me???
!! Thanks in advance !!

Peraphs stupid qiestion on Email

$
0
0
Is possible via vb6 code, to intercept an Email before tath go in the Outlook, or other Email programm?

If Yes, is possible to read all property from the email, similar server sent, id , sender name, trust server ecc...

F1 (context help) problems

$
0
0
Dear forum:

Painfully, I installed Visual Basic 6.0 in Windows 7-32 bits and Windows 8.1-64 bits.

Both installations work perfectly. But context help (F1 key) using DAO3.60, only works seamlessly in W8 machine. In W7, it work OK if I use DAO3.51, but with DAO3.60 as reference, I get the message "Error unknown" or "Help not available" (in Spanish).

I tried several "solutions": copy DAO360.CHM (could not get DAO360.chi) in MSDN help folder, add a reference in registry, but no success. Any ideas?? It seems that W8, even with old programs, manages help in a different way.

Anyway, I am moving, slowly, to .NET :thumb:

Daniel

Online Scheduler

$
0
0
So I have a request to build an on-line scheduling program. Something that lets people log into a web site, book an appointment, then have that web site send data to a VB6 program.

Would somebody please type out the code and post it here? :)

Just kidding. But I'm seriously lost. Any ideas where to even start with something like this?

"Next" Inside "If" Issue

$
0
0
Here is the code I'm having an issue with:

If txtNewUser.Text <> "" Then
strNewUser = txtNewUser.Text
For Module2.IndexUser = 0 To 1

If Module2.strUserName(Module2.IndexUser) <> "" Then 'If the current index location is full
Next Module2.IndexUser 'Choose the next available index location
Module2.strUserName(Module2.IndexUser) = strNewUser 'Add the registration data to the index location chosen in previous step

ElseIf Module2.strUserName(Module2.IndexUser) = "" Then 'If the current index location is available
Module2.strUserName(Module2.IndexUser) = strNewUser 'Add the data to the current index location

ElseIf Module2.strUserName(1) <> "" Then 'If the array is full
MsgBox "Credentials' storage array is full"
End If
Exit For
End If

From my beginner knowledge, I need the "Next" statement inside of the "If" statement because I need the Index position to advance to the next available position if there is data in the current one. I need this also because I don't want the data to overwrite in the current Index position. Is there any way around this while still maintaining full functionality

convert kb to mb

$
0
0
convert kb to mb , kilobytes to megabytes:p:p:p:p:p:p:p:p:p:p:p:p:p:eek::eek::eek:

Transfer data from a Datagrid to a Flex Grid

$
0
0
Hello there, my friend and I are having some problems in transferring data from a datagrid to a flexgrid. If someone could shed some light on the matter it would be marvellous. Thanks

Newbie - editing VB code or finding a string

$
0
0
Hi Guys,

I was wounding if you can help me as I know nothing about VB.

First of all the original product is not mine but I have emailed the original author and have got not reply to my emails. so if this breaks any rules please let me know.

Right, I have downloaded a VB .exe called VAGtachoCD715B710A.exe this is a great little tool for repairing/adding a missing line into the user area of FTDI FT245RL chip.

What I would like to know can the code be edited so instead of it adding "CD715B710A" to the chip can I change it to another string?

I have looked and to hell of it I cant find where the CD715B710A would be.

Any help would be grateful :)

frmMain.frm (part 1)
Code:

VERSION 5.00
Begin VB.Form frmMain
  Caption = "VAGtachoCD715B710A"
  ScaleMode = 1
  AutoRedraw = False
  FontTransparent = True
  'Icon = n/a
  LinkTopic = "Form1"
  MaxButton = 0  'False
  MinButton = 0  'False
  ClientLeft = 4095
  ClientTop = 3525
  ClientWidth = 4110
  ClientHeight = 720
  Begin CommandButton CMdwritebytes
    Caption = "&Write"
    Left = 2760
    Top = 120
    Width = 1215
    Height = 495
    TabIndex = 1
  End
  Begin ListBox LoggerList
    Left = 120
    Top = 120
    Width = 2415
    Height = 450
    Enabled = 0  'False
    TabIndex = 0
  End
End

Attribute VB_Name = "frmMain"

'VA: 402A04
Private Declare Sub FT_EraseEE Lib "FTD2XX.DLL"()
'VA: 4029C0
Private Declare Sub FT_WriteEE Lib "FTD2XX.DLL"()
'VA: 40297C
Private Declare Sub FT_ReadEE Lib "FTD2XX.DLL"()
'VA: 402938
Private Declare Sub FT_EE_UARead Lib "FTD2XX.DLL"()
'VA: 4028F0
Private Declare Sub FT_EE_UAWrite Lib "FTD2XX.DLL"()
'VA: 4028A8
Private Declare Sub FT_EE_UASize Lib "FTD2XX.DLL"()
'VA: 402860
Private Declare Sub FT_EE_Read Lib "FTD2XX.DLL"()
'VA: 40281C
Private Declare Sub FT_EE_Program Lib "FTD2XX.DLL"()
'VA: 4027D4
Private Declare Sub agGetAddressForObject Lib "apigid32.dll"()
'VA: 402770
Private Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long
'VA: 40272C
Private Declare Function TerminateThread Lib "kernel32" Alias "TerminateThread" (ByVal hThread As Long, ByVal dwExitCode As Long) As Long
'VA: 4026E4
Private Declare Function CreateThread Lib "kernel32" Alias "CreateThread" (lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal dwStackSize As Long, lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadId As Long) As Long
'VA: 40269C
Private Declare Function SetEvent Lib "kernel32" Alias "SetEvent" (ByVal hEvent As Long) As Long
'VA: 402658
Private Declare Function WaitForSingleObject Lib "kernel32" Alias "WaitForSingleObject" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
'VA: 40260C
Private Declare Function CreateEvent Lib "kernel32" Alias "CreateEventA" (lpEventAttributes As SECURITY_ATTRIBUTES, ByVal bManualReset As Long, ByVal bInitialState As Long, ByVal lpName As String) As Long
'VA: 4025C4
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
'VA: 402574
Private Declare Sub FT_W32_SetCommState Lib "FTD2XX.DLL"()
'VA: 402524
Private Declare Sub FT_W32_GetCommState Lib "FTD2XX.DLL"()
'VA: 4024D8
Private Declare Sub FT_W32_GetOverlappedResult Lib "FTD2XX.DLL"()
'VA: 402484
Private Declare Sub FT_W32_WriteFile Lib "FTD2XX.DLL"()
'VA: 402438
Private Declare Sub FT_W32_ReadFile Lib "FTD2XX.DLL"()
'VA: 4023F0
Private Declare Sub FT_W32_CloseHandle Lib "FTD2XX.DLL"()
'VA: 4023A4
Private Declare Sub FT_W32_CreateFile Lib "FTD2XX.DLL"()
'VA: 402358
Private Declare Sub FTID_GetErrorCodeString Lib "FTChipID.DLL"()
'VA: 402308
Private Declare Sub FTID_GetDllVersion Lib "FTChipID.DLL"()
'VA: 4022BC
Private Declare Sub FTID_GetDeviceChipID Lib "FTChipID.DLL"()
'VA: 40226C
Private Declare Sub FTID_GetDeviceLocationID Lib "FTChipID.DLL"()
'VA: 402218
Private Declare Sub FTID_GetDeviceDescription Lib "FTChipID.DLL"()
'VA: 4021C4
Private Declare Sub FTID_GetDeviceSerialNumber Lib "FTChipID.DLL"()
'VA: 402190
Private Declare Sub FTID_GetNumDevices Lib "FTChipID.DLL"()
'VA: 402130
Private Declare Sub FT_Close Lib "FTD2XX.DLL"()
'VA: 4020EC
Private Declare Sub FT_Open Lib "FTD2XX.DLL"()
'VA: 4020AC
Private Declare Sub FT_ListDevices Lib "FTD2XX.DLL"()


Private Sub Form_Load() '404650
  loc_00404650: push ebp
  loc_00404651: mov ebp, esp
  loc_00404653: sub esp, 0000000Ch
  loc_00404656: push 00401236h ; undef 'Ignore this
  loc_0040465B: mov eax, fs:[00h]
  loc_00404661: push eax
  loc_00404662: mov fs:[00000000h], esp
  loc_00404669: sub esp, 00000034h
  loc_0040466C: push ebx
  loc_0040466D: push esi
  loc_0040466E: push edi
  loc_0040466F: mov var_C, esp
  loc_00404672: mov var_8, 00401160h
  loc_00404679: mov esi, Me
  loc_0040467C: mov eax, esi
  loc_0040467E: and eax, 00000001h
  loc_00404681: mov var_4, eax
  loc_00404684: and esi, FFFFFFFEh
  loc_00404687: push esi
  loc_00404688: mov Me, esi
  loc_0040468B: mov ecx, [esi]
  loc_0040468D: call [ecx+04h]
  loc_00404690: xor eax, eax
  loc_00404692: lea edx, var_38
  loc_00404695: mov var_38, eax
  loc_00404698: lea ecx, var_24
  loc_0040469B: mov var_24, eax
  loc_0040469E: mov var_28, eax
  loc_004046A1: mov var_30, eax
  loc_004046A4: mov var_38, 00000002h
  loc_004046AB: call [00401010h] ; %ecx = %S_edx_S '__vbaVarMove
  loc_004046B1: mov edx, [esi]
  loc_004046B3: push esi
  loc_004046B4: call [edx+00000300h]
  loc_004046BA: push eax
  loc_004046BB: lea eax, var_28
  loc_004046BE: push eax
  loc_004046BF: call [0040103Ch] ; Set %StkVar1 = %StkVar2 'Ignore this
  loc_004046C5: sub esp, 00000010h
  loc_004046C8: mov ecx, 0000000Ah
  loc_004046CD: mov ebx, esp
  loc_004046CF: mov var_38, ecx
  loc_004046D2: mov edi, eax
  loc_004046D4: mov eax, 80020004h
  loc_004046D9: mov [ebx], ecx
  loc_004046DB: mov ecx, var_34
  loc_004046DE: mov var_30, eax
  loc_004046E1: mov edx, [edi]
  loc_004046E3: mov [ebx+04h], ecx
  loc_004046E6: push 00402C6Ch ; "VAG-Tacho-2.XX "
  loc_004046EB: push edi
  loc_004046EC: mov [ebx+08h], eax
  loc_004046EF: mov eax, var_2C
  loc_004046F2: mov [ebx+0Ch], eax
  loc_004046F5: call [edx+000001ECh]
  loc_004046FB: test eax, eax
  loc_004046FD: fclex
  loc_004046FF: jnl 404713h
  loc_00404701: push 000001ECh
  loc_00404706: push 00402A48h
  loc_0040470B: push edi
  loc_0040470C: push eax
  loc_0040470D: call [00401034h] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4)
  loc_00404713: mov edi, [004010E0h] ; %ecx = ""
  loc_00404719: lea ecx, var_28
  loc_0040471C: call edi
  loc_0040471E: mov ecx, [esi]
  loc_00404720: push esi
  loc_00404721: call [ecx+00000300h]
  loc_00404727: lea edx, var_28
  loc_0040472A: push eax
  loc_0040472B: push edx
  loc_0040472C: call [0040103Ch] ; Set %StkVar1 = %StkVar2 'Ignore this
  loc_00404732: sub esp, 00000010h
  loc_00404735: mov ecx, 0000000Ah
  loc_0040473A: mov ebx, esp
  loc_0040473C: mov var_38, ecx
  loc_0040473F: mov esi, eax
  loc_00404741: mov eax, 80020004h
  loc_00404746: mov [ebx], ecx
  loc_00404748: mov ecx, var_34
  loc_0040474B: mov var_30, eax
  loc_0040474E: mov edx, [esi]
  loc_00404750: mov [ebx+04h], ecx
  loc_00404753: push 00402C90h ; "Diagnostika_plus@mail.ru  "
  loc_00404758: push esi
  loc_00404759: mov [ebx+08h], eax
  loc_0040475C: mov eax, var_2C
  loc_0040475F: mov [ebx+0Ch], eax
  loc_00404762: call [edx+000001ECh]
  loc_00404768: test eax, eax
  loc_0040476A: fclex
  loc_0040476C: jnl 404780h
  loc_0040476E: push 000001ECh
  loc_00404773: push 00402A48h
  loc_00404778: push esi
  loc_00404779: push eax
  loc_0040477A: call [00401034h] ; %StkVar1 = CheckObj(%StkVar2, %StkVar3, %StkVar4)
  loc_00404780: lea ecx, var_28
  loc_00404783: call edi
  loc_00404785: mov var_4, 00000000h
  loc_0040478C: push 004047A7h
  loc_00404791: jmp 40479Dh
  loc_00404793: lea ecx, var_28
  loc_00404796: call [004010E0h] ; %ecx = ""
  loc_0040479C: ret
  loc_0040479D: lea ecx, var_24
  loc_004047A0: call [00401014h] ; undef 'Ignore this '__vbaFreeVar
  loc_004047A6: ret
  loc_004047A7: mov eax, Me
  loc_004047AA: push eax
  loc_004047AB: mov ecx, [eax]
  loc_004047AD: call [ecx+08h]
  loc_004047B0: mov eax, var_4
  loc_004047B3: mov ecx, var_14
  loc_004047B6: pop edi
  loc_004047B7: pop esi
  loc_004047B8: mov fs:[00000000h], ecx
  loc_004047BF: pop ebx
  loc_004047C0: mov esp, ebp
  loc_004047C2: pop ebp
  loc_004047C3: retn 0004h
End Sub

Out of Memory Error in MSXML2.DOMDocument object

$
0
0
Hi
I'm using MSXML2.DOMDocument object for building XML. I'm getting the data from Database and creating the xml node and adding to the DOMDocument object. For this particular scenario I have 1,50,000 records. I's working fine up to 51,000 records, after that DOMDocument shows "Out of Memory" in xml property.

I have tried with MSXML4.DOMDocument, MSXML5.DOMDocument and MSXML6.DOMDocument object. still getting the same "out of Memory" issue.

Please suggest me in solving this issue.


Regards,
Mohan

[VB6] Out of Memory in MSXML2.DOMDocument object

$
0
0
I'm using MSXML2.DOMDocument object in my VB6 application for building XML. I'm getting data from Database and creating the node and assigning it to DOMDocument object. In this scenario i have 1,50,000 records, up to 52000 records DOMDocument object doesn't show any error. While processing further the DOMDocument object shows "Out of Memory".


I have tried with MSXML4.DOMDocument, MSXML5.DOMDocument and MSXML6.DOMDocument object’s, but still having the same issue.

Please help me in solving this issue.

Regards,
Mohan

Pivot Chart Subform embedded in SubForm

$
0
0
I am using Access 2010 and believe that is VBA. I have a form that grabs the filtered results from another form that is end-user input. I embedded a graph in the form and had to place it in the header because putting it in the details the graph appears after every single line of data. This is a continuous form and yes people say you cannot place a graph, but you can in header or footer. I want the form to remain continuous if humanly possible. So, I filter my results from the main form and then click to view the form with embeddded pivot chart and the form section is fine where the details are, it carries over the filter, but the graph does not. It captures and charts only the first row. It does this even if I place it in the details section. If I alter the code and have 2 docmd's, 1 to open the continuous form and 1 to open the pivot chart, the data filters over but that is only because in my do command at the end of each I have the GetFilterResults.

What I want it to have the GetFilterResults to filter to both but have them both display on 1 form. I tried doing this as a Report/SubReport and using the graphing that you can do with a SubReport, but I am not able to put in more than 1 value, 1 column and 1 header in the QueryDesign and not sure how to code in order to overcome that in VBA. Here is the code I have for my filter and I have the 2 docmds, but that again opens 2 separate forms and I don't want to do that. Well, I should say end-users don't want it like that. Any help, direction, etc would be appreciated as I have struggled with this for about 3wks now.

Code:


Option Compare Database
Option Explicit


Private Sub cmdReport_Click()
DoCmd.OpenForm "Search_Quality", acNormal, , GetFilterFromListBoxes
DoCmd.OpenForm "Graph", acFormPivotChart, , GetFilterFromListBoxes
DoCmd.close acForm, "Search_Quality_Programs", acSavePrompt
End Sub

Private Sub cmdReset_Click()
  Dim ctrl As Access.Control
  Dim itm As Variant
  For Each ctrl In Me.Controls
    If ctrl.ControlType = acListBox Then
      If ctrl.MultiSelect = 0 Then
        ctrl = Null
      Else
        For Each itm In ctrl.ItemsSelected
            ctrl.Selected(itm) = False
        Next
      End If
    End If
  Next ctrl
  Me.Filter = ""
  Me.FilterOn = False
End Sub

Private Sub cmdResults_Click()
  Dim formfilter As String
  formfilter = GetFilterFromListBoxes
  Debug.Print formfilter
  Me.FilterOn = False
  Me.Filter = formfilter
  Me.FilterOn = True
End Sub


Public Function GetFilterFromListBoxes() As String
  Dim lst As Access.ListBox
  Dim ctrl As Access.Control
  Dim fieldName As String
  Dim fieldType As String
  Dim TotalFilter As String
  Dim ListFilter As String
  Dim itm As Variant
  'Each listbox needs a tag property with the  field name and the field type
  'Seperate these with a ;
  'The types are Text, Numeric, or Date
  For Each ctrl In Me.Controls
    If ctrl.ControlType = acListBox Then
      fieldName = Split(ctrl.tag, ";")(0)
      fieldType = Split(ctrl.tag, ";")(1)
      For Each itm In ctrl.ItemsSelected
      If ListFilter = "" Then
        ListFilter = GetProperType(ctrl.ItemData(itm), fieldType)
      Else
        ListFilter = ListFilter & "," & GetProperType(ctrl.ItemData(itm), fieldType)
      End If
      Next itm
      If Not ListFilter = "" Then
          ListFilter = fieldName & " IN (" & ListFilter & ")"
      End If
      If TotalFilter = "" And ListFilter <> "" Then
        TotalFilter = ListFilter
      ElseIf TotalFilter <> "" And ListFilter <> "" Then
        TotalFilter = TotalFilter & " AND " & ListFilter
      End If
      ListFilter = ""
    End If
  Next ctrl
  GetFilterFromListBoxes = TotalFilter
End Function

Public Function GetProperType(varItem As Variant, fieldType As String) As Variant
  If fieldType = "Text" Then
    GetProperType = sqlTxt(varItem)
  ElseIf fieldType = "Date" Then
    GetProperType = SQLDate(varItem)
  Else
    GetProperType = varItem
  End If
End Function

Public Function sqlTxt(varItem As Variant) As Variant
  If Not IsNull(varItem) Then
    varItem = Replace(varItem, "'", "''")
    sqlTxt = "'" & varItem & "'"
  End If
End Function

Function SQLDate(varDate As Variant) As Variant
    If IsDate(varDate) Then
        If DateValue(varDate) = varDate Then
            SQLDate = Format$(varDate, "\#mm\/dd\/yyyy\#")
        Else
            SQLDate = Format$(varDate, "\#mm\/dd\/yyyy hh\:nn\:ss\#")
        End If
    End If
End Function

Viewing all 22090 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>