Solved How reference an IP Address Control In MS Access

nector

Member
Local time
Tomorrow, 01:23
Joined
Jan 21, 2020
Messages
462
I want to reference an Ip Address from a text control in a form to VBA , currently I'm hard coding it like below:

Code:
stUrl = "http://192.168.8.110:8080/xxxxxxxxxxxxxxxxxxxxxxxxxxxx"[CODE]

Now instead where I'm putting "192.168.8.110" I want to use a control as reference ,example "Forms!frmLogin!txtIPadress.Value"

How is the new string going to be in order to achieve the same results ?

[CODE]stUrl = "http://192.168.8.110:8080/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"


This is going to more important once those people who do not want using Manual IP addrress or Static , but continue with dynamic
 
If the control is text oriented (text box, combo box, list box), then its value will contain what you want. The & operator is concatenation. Use it like:

Code:
stUrl = "HTTP://" & me.ipcontrol & ":8080/xxxxxxxxxxxxxxxxxxx"

By the way, you don't need Me.IPControl.Value because .Value is the default for any control that HAS a .Value property.
 
Many thanks this is what I wanted
 

Users who are viewing this thread

Back
Top Bottom