473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Almost there...

I'm fairly new to this group as this is only my second posting but
nonetheless, I appreciate all the help I've received so far.

Anyway my original post was about how to use FindFirst to go to a
corresponding record that had two primary keys (ID, VISIT). And upon
the advice of people I was able to get FORM 1 to jump to a
corresponding record on FORM 2 using FindFirst and OpenArg in the
Form_Load procedure in Form 2. When I used the same
"rs.FindFirst Me.OpenArgs" in Form 1 to make it so that I can do the
reverse and jump to a corresponding record from FORM 2 to FORM 1 I get
an error "Run time error - 3421, Data Type conversion error" when I up
the DB from scratch. I think it's due to the fact that Form 1 gives
OpenArg valid values for Form 2 to use in the FormLoad when I go from
Form 1 to Form 2. but when the DB is opened from scratch, Form 1 has
no values for OpenArg when it loads up for the first time which I
believe causes this error. Is there a way to assign some sort of
default openarg value for Form 1 when it loads up for the first time?

Below is my Form Load Code that I use in BOTH forms:

Option Compare Database

Private Sub Form_Load()

Dim rs As Object

If IsNull(clinid) = False Then

Set rs = Me.Recordset.Clone
rs.FindFirst Me.OpenArgs

If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
Else
DoCmd.GoToRecord , , acNewRec
Forms!md12_part2_form!clinid.SetFocus
End If

Set rs = Nothing
End Sub
Any ideas would be greatly appreciated! Thanks!

Ryan

Nov 13 '05 #1
1 1283
> If IsNull(clinid) = False Then

Set rs = Me.Recordset.Clone
rs.FindFirst Me.OpenArgs

If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
Else
DoCmd.GoToRecord , , acNewRec
Forms!md12_part2_form!clinid.SetFocus
End If
If IsNull(clinid) = False And Not IsNull(Me.OpenArgs) Then

or perhaps

If IsNull(clinid) = False And Nz(Me.OpenArgs,"") <> "" Then

--
Wayne Morgan
MS Access MVP
"psydork" <rl**************@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com... I'm fairly new to this group as this is only my second posting but
nonetheless, I appreciate all the help I've received so far.

Anyway my original post was about how to use FindFirst to go to a
corresponding record that had two primary keys (ID, VISIT). And upon
the advice of people I was able to get FORM 1 to jump to a
corresponding record on FORM 2 using FindFirst and OpenArg in the
Form_Load procedure in Form 2. When I used the same
"rs.FindFirst Me.OpenArgs" in Form 1 to make it so that I can do the
reverse and jump to a corresponding record from FORM 2 to FORM 1 I get
an error "Run time error - 3421, Data Type conversion error" when I up
the DB from scratch. I think it's due to the fact that Form 1 gives
OpenArg valid values for Form 2 to use in the FormLoad when I go from
Form 1 to Form 2. but when the DB is opened from scratch, Form 1 has
no values for OpenArg when it loads up for the first time which I
believe causes this error. Is there a way to assign some sort of
default openarg value for Form 1 when it loads up for the first time?

Below is my Form Load Code that I use in BOTH forms:

Option Compare Database

Private Sub Form_Load()

Dim rs As Object

If IsNull(clinid) = False Then

Set rs = Me.Recordset.Clone
rs.FindFirst Me.OpenArgs

If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
Else
DoCmd.GoToRecord , , acNewRec
Forms!md12_part2_form!clinid.SetFocus
End If

Set rs = Nothing
End Sub
Any ideas would be greatly appreciated! Thanks!

Ryan

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: adMjb | last post by:
I think I am almost there, with help from Johannes Koch (thank you) last week: http://groups.google.co.uk/group/comp.text.xml/browse_thread/thread/b7f55bf554ee288d?hl=en ...
2
by: DS | last post by:
This code almost works, The only problem, is that it always Opens the "Invalid ID" form whether the ID is valid or not, what am I doing wrong? Thanks DS If Display = DLookup("EmployeeID",...
15
by: Steve Richfield | last post by:
To All, First, some of your replies to me have been posted through DevelopersDex, and these are NOT posted on USENET for the world to see. DevelopersDex appears to be trying to hijack USENET,...
25
by: MadCrazyNewbie | last post by:
Hey Group, Im Sure this is simple but I carn`t seem to find any info anywhere:( I have 2 x Forms: Form 1 has a DataConnecter and several DataAdapters on it, all bound together in my DataSet. ...
13
by: Just Me | last post by:
The following almost works. The problem is Marshal.PtrToStringAuto seems to terminate at the first null so I don't get the full string. Any suggestions on how to fix this? Or how to improve the...
1
by: Rob | last post by:
The code below is almost there (it does change the value for EVERY ORDER).... I simply want to be able to change the value of the Delivered Tag to Yes. BUT ONLY if the Order is equal to 123456 ? ...
1
by: swynne | last post by:
Hi friendly people...I am a newb to programming and need a little assistance. I have a small personal ad database created in Access, however all is well until I want the personal ad link to take me...
3
by: FFMG | last post by:
Hi, I am looking for a way to compare 2 short paragraphs that are almost the same. Is there some kind of algorithm that would allow us to compare the two and return some kind of likely hood...
1
by: bearophileHUGS | last post by:
Once in a while I feel free to write about less defined things, saying mostly wrong things. This post is mostly chat, if you aren't interested please ignore it. Python is fit enough for newbie...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.