0

在以下代码示例中,[MainSwitchBoardPhone] 的属性类型为“Phone”。当我将计算出的 ClinicHospitalAddress 属性设为实体的摘要属性时,我希望电话号码以 (555) 555-5555 格式显示在数据输入屏幕中,而不仅仅是字符串。即5555555555。有没有办法做到这一点?

Private Sub ClinicHospitalAddress_Compute(ByRef result As String)
  ' Set result to the desired field value
  result = [ClinicHospital] & " " & [StreetAddress] & ", " & _
           [City] & " " & [MainSwitchBoardPhone]
4

2 回答 2

0

如下:

result = [ClinicHospital] & " " & [StreetAddress] & ", " & _

[城市] & " " & Format([MainSwitchBoardPhone],"(###) ###-####")

于 2013-04-05T02:23:11.407 回答
0

尝试:

result = String.Format("{0} {1}, {2} (###) ###-####" _
    , [ClinicHospital] _
    , [StreetAddress] _
    , [City] _
    , Convert.ToInt64([MainSwitchBoardPhone]) _
    )

编辑:添加 Convert.ToInt64

于 2013-04-05T12:17:12.237 回答