John,
Sorry for my little knowledge is this event for Form "AddCityCountry" or Form "frmAddressSubform" ?
Khalid
---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :
Khalid-
John,
---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :
Private Sub Form_Load()
Dim intI As Integer, strCity As String, strCountry As String
' If nothing in OpenArgs,
If Len(Me.OpenArgs) = 0 Then
' Nothing to do
Exit Sub
End If
' See if there's a comma
intI = Instr(Me.Openargs, ",")
' If no comma,
If intI = 0 Then
' Just set City
Me.City = Me.OpenArgs
Else
' Set City and Country
Me.City = Left(Me.OpenArgs, intI - 1)
Me.Country = Trim(Mid(Me.OpenArgs, intI + 1))
End If
End Sub
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On May 4, 2017, at 9:12 PM, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
John,
I have made a new Form "AddCityCountry" having Record Source table "MainCity". Also added field
"Country" in table "MainCity" for the current data in table "MainCity" against field "MainCityName" entered manually country names.
The portion you told:
You can pass what the user entered in the Openargs parameter.
In the Load event of the data entry form, parse the two parts (look for the comma with InStr)
and place the values in the two controls.
I could not get it John, could you please explain or give example.
I have done this portion:
You'll also need code after the form closes (probably
via a Save and Close button on the dialog form) to check to see that the data got entered.
Regards,
Khalid
---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :
Khalid-
If you put both fields in one table, you need one combo box that displays both fields (city, country), and instead of simply inserting the data, you need to open a form in data entry and dialog mode (to halt the calling code) that lets the user enter both fields. You can pass what the user entered in the Openargs parameter. In the Load event of the data entry form, parse the two parts (look for the comma with InStr) and place the values in the two controls. You'll also need code after the form closes (probably via a Save and Close button on the dialog form) to check to see that the data got entered.
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On May 4, 2017, at 11:01 AM, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
__._,_.___
Posted by: khalidtanweerburrah@yahoo.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (5) |
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.
.
__,_._,___
Tidak ada komentar:
Posting Komentar