簡體   English   中英

從單元格中獲取值

[英]Getting the value from cell

我想從 Range("C6") 中獲取值 (T28200006)。

我收到此錯誤:

在此處輸入圖像描述

Public Sub INFO_PROTO1(ByRef strQ As String)

Dim RECSET As New ADODB.Recordset, numero_de_police

If Len(numero_de_police) > 0 Then
    RECSET.Open " select sousc.is_produit as b_perf_cma from db_dossier sousc,db_produit prod, db_protocole proto" & _
        " where sousc.no_police = " & numero_de_police & "  and sousc.cd_dossier = 'SOUSC' and " & _
        " sousc.lp_etat_doss not in ('ANNUL','A30','IMPAY') and sousc.is_produit = prod.is_produit  ", cnn_Pegase, adOpenDynamic, adLockBatchOptimistic
    
    With Worksheets("1 - Feuille de Suivi Commercial").Range("Calcul_CMA_Origine")

您的查詢值不是數字,因此您需要在 SQL 中引用它:

..." where sousc.no_police = '" & numero_de_police & "'  and...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM