Solved How reference an IP Address Control In MS Access (1 Viewer)

nector

Member
Local time
Today, 16:11
Joined
Jan 21, 2020
Messages
414
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
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:11
Joined
Feb 28, 2001
Messages
27,675
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.
 

nector

Member
Local time
Today, 16:11
Joined
Jan 21, 2020
Messages
414
Many thanks this is what I wanted
 

Users who are viewing this thread

Top Bottom