Jumat, 01 Februari 2019

Re: [MS_AccessPros] Displaying file names of a specific folder in a list box, and running the selected file afterwards.

 

Dear Duane,

Thanks a lot. I am going to try right away.

Best Regards,

Kevin

On 02-Feb-2019 2:07 PM, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] wrote:
�

Kevin,
I expect code like the following should work depending on the names of your controls and properties of your list box:

Private Sub cmdFillLbo_Click()
� � Dim strFiles As String
� � Dim strFile As String
� � Dim strFolder As String
� � strFolder = Me.txtFolderName & "\"
� � strFile = Dir(strFolder)
� � strFiles = strFile
� � Do Until Len(strFile) = 0
� � � � strFile = Dir()
� � � � strFiles = strFiles & ";" & strFile
� � Loop
� � Me.lboFileNames.RowSource = strFiles
End Sub

Private Sub lboFileNames_DblClick(Cancel As Integer)
� � Dim strFile As String
� � strFile = Me.txtFolderName & "\" & Me.lboFileNames
� � FollowHyperlink strFile
End Sub

Duane


From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Qingqing qingqinga@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, February 1, 2019 11:14 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Displaying file names of a specific folder in a list box, and running the selected file afterwards.
�
Dear All,
Is it possible to display file names of a specific folder in a list box on a form?� and afterwards double click on a selected file name to open it? Thanks.
Best Regards,
Kevin



------------------------------------
Posted by: Qingqing <qingqinga@yahoo.com>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
��� http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
��� Individual Email | Traditional

<*> To change settings online go to:
��� http://groups.yahoo.com/group/MS_Access_Professionals/join
��� (Yahoo! ID required)

<*> To change settings via email:
��� MS_Access_Professionals-digest@yahoogroups.com
��� MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
��� MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
��� https://info.yahoo.com/legal/us/yahoo/utos/terms/

__._,_.___

Posted by: Kevin <qingqinga@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Re: [MS_AccessPros] Displaying file names of a specific folder in a list box, and running the selected file afterwards.

 

Kevin,
I expect code like the following should work depending on the names of your controls and properties of your list box:

Private Sub cmdFillLbo_Click()
    Dim strFiles As String
    Dim strFile As String
    Dim strFolder As String
    strFolder = Me.txtFolderName & "\"
    strFile = Dir(strFolder)
    strFiles = strFile
    Do Until Len(strFile) = 0
        strFile = Dir()
        strFiles = strFiles & ";" & strFile
    Loop
    Me.lboFileNames.RowSource = strFiles
End Sub

Private Sub lboFileNames_DblClick(Cancel As Integer)
    Dim strFile As String
    strFile = Me.txtFolderName & "\" & Me.lboFileNames
    FollowHyperlink strFile
End Sub

Duane


From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Qingqing qingqinga@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, February 1, 2019 11:14 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Displaying file names of a specific folder in a list box, and running the selected file afterwards.
 
Dear All,
Is it possible to display file names of a specific folder in a list box on a form?  and afterwards double click on a selected file name to open it? Thanks.
Best Regards,
Kevin



------------------------------------
Posted by: Qingqing <qingqinga@yahoo.com>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/join
    (Yahoo! ID required)

<*> To change settings via email:
    MS_Access_Professionals-digest@yahoogroups.com
    MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

[MS_AccessPros] Displaying file names of a specific folder in a list box, and running the selected file afterwards.

 

Dear All,
Is it possible to display file names of a specific folder in a list box on a form? and afterwards double click on a selected file name to open it? Thanks.
Best Regards,
Kevin

__._,_.___

Posted by: Qingqing <qingqinga@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Re: [MS_AccessPros] Debug.Print does not work

 

Dear Duane,
I learned a lot from you. Thank you so much.
Best Regards,
Kevin

发自 WPS邮箱客戶端
在 "Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2019年1月29日 23:03写道:

 

HI Kevin,

I would add comments:
You have memory variables with names like "str..." yet are storing numeric values. It is more conventional to use something like:
Dim lngContractTotalAmountNotReceivedPercent  As Long

Also you have an IIf() expression that might return a string and might return numeric. IMHO, this is never a good idea. 
 
strContractTotalAmountNotReceivedPercent = IIf(strContractTotalAmount = 0, "", strContractTotalAmountNotReceived / strContractTotalAmount)

Your line:
"SET [ContractTotalAmountReceivedTXT] = ' " & strContractTotalAmountReceivedTXT & " ', " & _
adds an extra space before and after the value. Is the field ContractTotalAMountReceivedTXT actually text? Is this all be design?

Possibly this data is all used for merging or displaying which would shed some light on your usage.

Regards,
Duane

From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, January 29, 2019 7:27 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Debug.Print does not work
 
hi Kevin,

NZ before IIF is in the wrong place ... it should surround anything you
want to handle Null for

IIf( Nz(strAirTicketInsuranceVisaTotal,0) = 0, 0, Nz(strTotalAirVisaInsuranceReceived, 0) / Nz
(strAirTicketInsuranceVisaTotal,1) )

the reason why you also need it around the divisor is that Access evaluates all parts of IIF, even the part that doesn't apply -- so it can't make an error -- note that the optional 2nd argument in that case is 1 not 0 since you dividing by zero is not mathematically possible

have an awesome day,
crystal

On 1/28/2019 11:19 PM, qingqinga@yahoo.com [MS_Access_Professionals] wrote:
> Dear Duane,
>
> I can't figure out what's wrong this this line. please help.
>
> strTotalAirVisaInsuranceReceivedPercent = Nz(IIf(strAirTicketInsuranceVisaTotal = 0, 0, Nz(strTotalAirVisaInsuranceReceived, 0) / strAirTicketInsuranceVisaTotal), 0)
>
> My problem is either strAirTicketInsuranceVisaTota or strAirTicketInsuranceVisaTotal are Null or zero, it will block the whole process.
>
> Best Regards,
> Kevin
> --------------------------------------------
> On Tue, 1/29/19, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
>
>   Subject: Re: [MS_AccessPros] Debug.Print does not work
>   To: "MS_Access_Professionals@yahoogroups.com" <MS_Access_Professionals@yahoogroups.com>
>   Date: Tuesday, January 29, 2019, 12:38 PM
>  
>   
>   Hi Kevin,
>  
>   It doesn't work like that. I think the instructions are
>   fairly simple. If you don't understand about break
>   points of compiling your VBA code, try Bing/Google for more
>   information.
>  
>  
>   Duane
>  
>  
>   From:
>   MS_Access_Professionals@yahoogroups.com
>   <MS_Access_Professionals@yahoogroups.com> on behalf of
>   qingqinga@yahoo.com [MS_Access_Professionals]
>    <MS_Access_Professionals@yahoogroups.com>
>  
>   Sent: Monday, January 28, 2019 10:30 PM
>  
>   To: MS_Access_Professionals@yahoogroups.com
>  
>   Subject: Re: [MS_AccessPros] Debug.Print does not
>   work
>   
>  
>  
>   Dear
>   Duane,
>  
>   May I phone you for just few minutes? Thanks in advance.
>  
>   Best Regards,
>  
>   Kevin
>  
>
>   --------------------------------------------
>  
>   On Tue, 1/29/19, Duane Hookom duanehookom@hotmail.com
>   [MS_Access_Professionals]
>   <MS_Access_Professionals@yahoogroups.com> wrote:
>  
>  
>  
>    Subject: Re: [MS_AccessPros] Debug.Print does not work
>  
>    To: "ms_access_professionals@yahoogroups.com"
>   <ms_access_professionals@yahoogroups.com>
>  
>    Date: Tuesday, January 29, 2019, 12:10 PM
>  
>   
>  
>    Does the code compile?  Have
>  
>    you set a break point and stepped through the lines of
>  
>    code?
>  
>  
>    Duane
>  
>   
>  
>    From:
>  
>    ms_access_professionals@yahoogroups.com on behalf of
>  
>    qingqinga@yahoo.com [MS_Access_Professionals]
>  
>    <ms_access_professionals@yahoogroups.com>
>  
>   
>  
>    Sent: Monday, January 28, 2019 9:47 PM
>  
>   
>  
>    To: ms_access_professionals@yahoogroups.com
>  
>   
>  
>    Subject: [MS_AccessPros] Debug.Print does not work
>  
>    
>  
>   
>  
>    Dear All,
>  
>   
>  
>    Debug does not work this this code. Please help:
>  
>   
>  
>   
>  
>   
>  
>    Private Sub Form_BeforeUpdate(Cancel As Integer)
>  
>   
>  
>   
>  
>   
>  
>    On Error GoTo ErrHandle
>  
>   
>  
>   
>  
>   
>  
>    Me.RecordDate = Date
>  
>   
>  
>    Me.TransactionEmployeeID = Forms!frmWelcome!EmployeeID
>  
>   
>  
>   
>  
>   
>  
>    Dim strSQL As String
>  
>   
>  
>    Dim strContractCurrency As String
>  
>   
>  
>    Dim strFinalCurrency As String
>  
>   
>  
>   
>  
>   
>  
>   
>  
>   
>  
>    Dim strContractTotalAmount As Long '地接合同款
>  
>  
>   
>  
>    Dim strContractTotalAmountReceived As Long
>  
>    '地接团款已收
>  
>   
>  
>    Dim strContractTotalAmountReceivedTXT As String
>  
>   
>  
>    Dim strContractTotalAmountNotReceived
>  
>    '地接团款未收
>  
>   
>  
>    Dim strContractTotalAmountNotReceivedTXT As String
>  
>   
>  
>    Dim strContractTotalAmountReceivedPercent As Long
>  
>    '收到百分比
>  
>   
>  
>    Dim strContractTotalAmountNotReceivedPercent As Long
>  
>    '未收到百分比
>  
>   
>  
>   
>  
>   
>  
>    Dim strAirTicketInsuranceVisaTotal As Long
>   '机保签款
>  
>   
>  
>   
>  
>    Dim strTotalAirVisaInsuranceReceived As Long
>  
>    '机保签已收
>  
>   
>  
>    Dim strTotalAirVisaInsuranceReceivedTXT As String
>  
>   
>  
>    Dim strTotalAirVisaInsuranceNotReceived As Long
>  
>    '机保签未收
>  
>   
>  
>    Dim strTotalAirVisaInsuranceNotReceivedTXT As String
>  
>   
>  
>    Dim strTotalAirVisaInsuranceReceivedPercent As Long
>  
>    '收到百分比
>  
>   
>  
>    Dim strTotalAirVisaInsuranceNotReceivedPercent As Long
>  
>    '未收到百分比
>  
>   
>  
>   
>  
>   
>  
>    strContractCurrency =
>   ELookup("ContractCurrency",
>  
>    "tblGroup", "GroupID=" &
>  
>    Nz(Me.GroupID, 0))
>  
>   
>  
>   
>  
>    strFinalCurrency = ELookup("FinalCurrency",
>  
>    "tblGroup", "GroupID=" &
>  
>    Nz(Me.GroupID, 0))
>  
>   
>  
>   
>  
>    strContractTotalAmount =
>  
>    ELookup("ContractTotalAmount",
>  
>    "tblGroup", "GroupID=" &
>  
>    Nz(Me.GroupID, 0))
>  
>   
>  
>   
>  
>    strAirTicketInsuranceVisaTotal =
>  
>    ELookup("AirTicketInsuranceVisaTotal",
>  
>    "tblGroup", "GroupID=" &
>  
>    Nz(Me.GroupID, 0))
>  
>   
>  
>   
>  
>   
>  
>   
>  
>    strContractTotalAmountReceived =
>  
>    Nz(DSum("AmountContract",
>  
>    "qryTransactionTotalCalc",
>   "Checked="
>  
>    & True & "AND OfficeLocationID=" &
>   1
>  
>    & "AND CostTypeID=" & 17 &
>   "AND
>  
>    GroupID=" & Nz(Me.GroupID, 0)), 0)
>  
>   
>  
>   
>  
>    strContractTotalAmountReceivedTXT = strContractCurrency
>  
>    & " " &
>   strContractTotalAmountReceived
>  
>   
>  
>   
>  
>    strContractTotalAmountNotReceived = strContractTotalAmount
>   -
>  
>    strContractTotalAmountReceived
>  
>   
>  
>   
>  
>    strContractTotalAmountNotReceivedTXT =
>   strContractCurrency
>  
>    & " " &
>   strContractTotalAmountNotReceived
>  
>   
>  
>   
>  
>    strContractTotalAmountReceivedPercent =
>  
>    IIf(strContractTotalAmount = 0, "",
>  
>    strContractTotalAmountReceived /
>   strContractTotalAmount)
>  
>   
>  
>   
>  
>    strContractTotalAmountNotReceivedPercent =
>  
>    IIf(strContractTotalAmount = 0, "",
>  
>    strContractTotalAmountNotReceived /
>   strContractTotalAmount)
>  
>   
>  
>   
>  
>   
>  
>   
>  
>    strTotalAirVisaInsuranceReceived =
>  
>    Nz(DSum("AmountFinal",
>  
>    "qryTransactionTotalCalc",
>   "Checked="
>  
>    & True & "AND OfficeLocationID=" &
>   1
>  
>    & "AND CostTypeID=" & 21 &
>   "AND
>  
>    GroupID=" & Nz(Me.GroupID, 0)), 0)
>  
>   
>  
>   
>  
>    strTotalAirVisaInsuranceReceivedTXT = strFinalCurrency
>   &
>  
>    " " & strTotalAirVisaInsuranceReceived
>  
>   
>  
>   
>  
>    strTotalAirVisaInsuranceNotReceived =
>  
>    strAirTicketInsuranceVisaTotal -
>  
>    strTotalAirVisaInsuranceReceived
>  
>   
>  
>   
>  
>    strTotalAirVisaInsuranceNotReceivedTXT =
>   strFinalCurrency
>  
>    & " " &
>  
>    strTotalAirVisaInsuranceNotReceived
>  
>   
>  
>   
>  
>    strTotalAirVisaInsuranceReceivedPercent =
>  
>    IIf(strAirTicketInsuranceVisaTotal = 0, "",
>  
>    strTotalAirVisaInsuranceReceived /
>  
>    strAirTicketInsuranceVisaTotal)
>  
>   
>  
>   
>  
>    strTotalAirVisaInsuranceNotReceivedPercent =
>  
>    IIf(strAirTicketInsuranceVisaTotal = 0, "",
>  
>    strTotalAirVisaInsuranceNotReceived /
>  
>    strAirTicketInsuranceVisaTotal)
>  
>   
>  
>   
>  
>   
>  
>   
>  
>   
>  
>   
>  
>    strSQL = "UPDATE tblGroup " & _
>  
>   
>  
>    "SET [ContractTotalAmountReceived] = " &
>  
>    strContractTotalAmountReceived & ", " &
>   _
>  
>   
>  
>   
>  
>    "SET [ContractTotalAmountReceivedTXT] = '
>   "
>  
>    & strContractTotalAmountReceivedTXT & "
>   ',
>  
>    " & _
>  
>   
>  
>   
>  
>    "SET [ContractTotalAmountNotReceived] = "
>   &
>  
>    strContractTotalAmountNotReceived & ", "
>   &
>  
>    _
>  
>   
>  
>   
>  
>    "SET [ContractTotalAmountNotReceivedTXT] = '
>   "
>  
>    & strContractTotalAmountNotReceivedTXT & "
>  
>    ', " & _
>  
>   
>  
>   
>  
>    "SET [ContractTotalAmountReceivedPercent] = "
>  
>    & strContractTotalAmountReceivedPercent &
>   ",
>  
>    " & _
>  
>   
>  
>   
>  
>    "SET [ContractTotalAmountNotReceivedPercent] =
>   "
>  
>    & strContractTotalAmountNotReceivedPercent &
>   ",
>  
>    " & _
>  
>   
>  
>   
>  
>    "SET [TotalAirVisaInsuranceReceived] = "
>   &
>  
>    strTotalAirVisaInsuranceReceived & ", "
>   &
>  
>    _
>  
>   
>  
>   
>  
>    "SET [TotalAirVisaInsuranceReceivedTXT] = '
>   "
>  
>    & strTotalAirVisaInsuranceReceivedTXT & "
>  
>    ', " & _
>  
>   
>  
>   
>  
>    "SET [TotalAirVisaInsuranceNotReceived] = "
>   &
>  
>    strTotalAirVisaInsuranceNotReceived & ",
>   "
>  
>    & _
>  
>   
>  
>   
>  
>    "SET [TotalAirVisaInsuranceNotReceivedTXT] = '
>  
>    " & strTotalAirVisaInsuranceNotReceivedTXT
>   &
>  
>    " ', " & _
>  
>   
>  
>   
>  
>    "SET [TotalAirVisaInsuranceReceivedPercent] =
>   "
>  
>    & strTotalAirVisaInsuranceReceivedPercent &
>   ",
>  
>    " & _
>  
>   
>  
>   
>  
>    "SET [TotalAirVisaInsuranceNotReceivedPercent] =
>   "
>  
>    & strTotalAirVisaInsuranceNotReceivedPercent &
>   _
>  
>   
>  
>   
>  
>    " WHERE GroupID = " & Me.GroupID
>  
>   
>  
>   
>  
>   
>  
>    Debug.Print strSQL
>  
>   
>  
>    CurrentDb.Execute strSQL, dbFailOnError
>  
>   
>  
>   
>  
>   
>  
>   
>  
>   
>  
>    ErrExit:
>  
>   
>  
>    Exit Sub
>  
>   
>  
>   
>  
>   
>  
>    ErrHandle:
>  
>   
>  
>    Resume ErrExit
>  
>   
>  
>   
>  
>   
>  
>    End Sub
>  
>   
>  
>   
>  
>   
>  
>    Thanks in advance,
>  
>   
>  
>    Best Regards,
>  
>   
>  
>    Kevin
>  
>   
>  
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>


------------------------------------
Posted by: crystal 8 <strive4peace2008@yahoo.com>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/join
    (Yahoo! ID required)

<*> To change settings via email:
    MS_Access_Professionals-digest@yahoogroups.com
    MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

__._,_.___

Posted by: qingqinga <qingqinga@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (17)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

[belajar-access] File - Tata Tertib dan Aturan.txt

 


Tata tertib dan peraturan
Mailing List: belajar-access@yahoogroups.com

1. Mailing list ini membahas mengenai pemrograman Microsoft Access.
2. Tidak diperkenankan mem-posting topik yang tidak ada kaitannya sama sekali dengan pemrograman MS Access, peluang kerja atau tawaran kerja sama dengan keahlian di bidang MS Access, atau pengajaran/kursus MS Acces. Pelanggaran terhadap aturan ini akan di-ban dari keanggotaan milis ini.
3. Mohon berdiskusi dengan baik, dengan semangat membangun, demi kemajuan kita bersama. Hindarilah perbantahan (flame) yang bisa menjadi pertengkaran yang tidak perlu.
4 Hindari reply permintaan one-liner seperti 'saya minta juga dong', 'saya setuju', dan lain-lain yang tidak perlu.
5. Sedapat mungkin memberikan data-data yang lengkap dalam mengajukan suatu masalah untuk memudahkan rekan-rekan sesama member mengidentifikasi dan mencarikan solusi, termasuk memberikan subject yang sesuai dengan isi email, tidak dengan kata-kata seperti "tologing dong", "pusing...", "ada yang bisa bantu..", dll.

Moderator

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (143)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

SPAM IS PROHIBITED

SPONSORED LINKS
.

__,_._,___